Casa de TrailMyx > Scripting Languages

VS 2008 C# Form Dropdown box Question.

(1/5) > >>

Coragin:
Okay so I have a dropdown box with two options.  Option1 and Option2.

I also have a control grid for each which is by default hidden unless the choose one of the two options.

If they choose option1, option1controls will appear.

If they choose option 2, option2controls will appear.

My question is, how do I set it to do that?  I highlight the dropdown list control, filter through all the options and cant seem to find the property stings I have in the list.  Or a way that if this one is selected, show this control if this one is selected show the other.

Secondly, I need a directory selection path, for the uo client files.  I have tried every control there is in VS2k8 forms and cant seem to find this one.

Finally anyone got a good site with documentation and "how to" with regards to forms?

TrailMyx:
You'll spend a lot of time at MSDN looking through the docs.  :)

draxxter:
Well i guess you mean DropDownList control. Then you need to hook your code in SelectedIndexChanged Event to hide/show the Grids.
With controlid.SelectedItem you get the ListItem, with controlid.SelectedValue you get the Item Value, etc etc.
Also you will need to have the grid for option 1 visible by default since option 1 will be already selected since you have only 2 options.
A work around is to add another item as a dummy something like "Nothing Selected...".


Not sure i got the selection path part of your question.

UOMaddog:
It's all going to be done in the .cs file that is attached to that form.

Something along of the lines of:


--- Code: ---if Dropdownboxid.option[0] == true
{
controls1id.visible = true;
}
if Dropdownboxid.option[1] == true
{
controls2id.visible = true;
}
--- End code ---

that's not exact code since I don't know the exact id's of what you're doing, but it will look similar to that

Coragin:

--- Quote from: UOMaddog on March 05, 2010, 12:58:36 PM ---It's all going to be done in the .cs file that is attached to that form.

Something along of the lines of:


--- Code: ---if Dropdownboxid.option[0] == true
{
controls1id.visible = true;
}
if Dropdownboxid.option[1] == true
{
controls2id.visible = true;
}
--- End code ---

that's not exact code since I don't know the exact id's of what you're doing, but it will look similar to that

--- End quote ---

AH HA!  That is exactly what I needed.  If it dont work I will post, but thank you!!!  U DA MAN!

Navigation

[0] Message Index

[#] Next page

Go to full version