Derma Combobox

[lua]
local TestingComboBox = vgui.Create( “DComboBox”, DermaFrame )
TestingComboBox:SetPos( 10, 35 )
TestingComboBox:SetSize( 100, 185 )
TestingComboBox:SetMultiple( false ) – Don’t use this unless you know extensive knowledge about tables
TestingComboBox:AddItem( “Add” ) – Add our options
TestingComboBox:AddItem( “Some” )
TestingComboBox:AddItem( “Options” )
TestingComboBox:AddItem( “Here” )

local MainMenuSheet = vgui.Create( “DPanel”, DermaFrame ) – We create a panel so we can draw shit on; if we use the frame, it comes up transparent for some reason
MainMenuSheet:SetPos( 125, 50 )
MainMenuSheet:SetSize( DermaFrame:GetWide() - 25, DermaFrame:GetTall() - 25 )
MainMenuSheet.Paint = function()
if TestingComboBox:GetSelectedItems() and TestingComboBox:GetSelectedItems()[1] then – make sure something is selected if not we get uber spam of errors
local OurStringThing = “Your selection is: “…TestingComboBox:GetSelectedItems()[1]:GetValue()…”!” – This was a pain in the ass to figure out; this gets the name of the option chosen
surface.SetFont( “default” )
surface.SetTextColor( 255, 255, 255, 255 )
surface.SetTextPos( 50, 50 )
surface.DrawText( OurStringThing ) – Draws the text
end
end
[/lua]

How would i edit this so that each combobox item had a different value to what it actually says?

If I understand what you mean, you can try setting a value on the panel variable to whatever you want.

[lua]local box = ComboBox:AddItem(“Item”)
box.Value = 10
print(box.Value)[/lua]

However, I’m not sure if AddItem returns the panel object. If that’s the case, then you have to hold the item names in a table with a value of whatever.

[lua]local stuff ={
[“Add”] = 10,
[“Some”] = Vector(0,0,5),
[“Options”] = Entity(1),
}

ComboBox:AddItem( “Add” )
ComboBox:AddItem( “Some” )
ComboBox:AddItem( “Options” )

– Then the value is stuff[ ComboBox:GetSelectedItem():GetValue() ][/lua]

We are Air Jordan UGG Boots Jerseys and GHD online store,supply all cheap price products,Such as Uggs Classic Tall,Ugg Bailey Button,Air Jordan online store,Nike Air Jordan,NACC Jerseys,Cheap NFL Jerseys, Cheap NHL Jerseys, NBA Jerseys,Cheap cartier glasses,GHD, New styles and hot styles are active every day.We wholesale our products at very low price but with high quality.Our products are always very hot in USA,UK, Canada, Australia, etc., Many wholesalers, retailers, shop owner, online store owner, byers buy and resell our products.UGG Classic Tall Boots sale - we offer high quality discount UGG Classic Tall Boots at wholesale price,cheap UGG Classic Tall Boots,Free Shipping.