Select to view content in your preferred language

Checkbox and Radio Button Programming on GUI

3853
49
Jump to solution
02-20-2014 10:33 AM
MichelleCouden
Regular Contributor
Am I on the right path here with my checkboxes and radio button programming. I have about three different checkboxes and a few radio button that I need to use in a If then statement. Unless, there is a simplier way of calling a layer using them...

private void checkBox1_Checked Changed(object sender, EventArgs e)

      If (checkboxstate.checked == true) Then
           If radioAtr.Enabled Then openFileDialog.InitialDirectory = "K:\"......

All help is extremely appreciated. Thanks!
0 Kudos
49 Replies
LeoDonahue
Deactivated User
first thoughts are you have your GUI items switched around?  Can you have a State and District manual map?  If not, that is what you are allowing your users to select.
0 Kudos
MichelleCouden1
Deactivated User
That's why I think I'm going to go with your idea and use the tabs it will be simplier. I think I am making it harder than it is. No, there would be a tab for state, tab for Austin, tab for San Antonio, etc.. So, the tab example I sent you there would be a tab for each district with those same stations on each tab for the user to select from. See Attached!
0 Kudos
LeoDonahue
Deactivated User
Stations are considered to be one of the following?  ATR, AVC, BC, LTPP, Manual and Toll Road?

Now that I see what you are trying to do, using Radio Buttons for the State, Austin, San Antonio, etc. makes more sense because you can only have one of those selected at a time, right?

And I would use checkboxes for: ATR, AVC, BC, LTPP, Manual and Toll Road options, because you said you can have multiple of those checked at the same time.

Now you don't have to repeat all of the: ATR, AVC, BC, LTPP, Manual and Toll Road checkboxes on different tabs.
MichelleCouden1
Deactivated User
So, I've started the new program. The new GUI is attached!
0 Kudos
LeoDonahue
Deactivated User
Didn't Ken or I give you this answer a long time ago?  I thought we did. 

It was something about building a string value based on what you have selected compared with the naming structure of your data directory?

You would concatenate the value of the Radio button (State, Austin, San Antonio, etc) with the values selected from your stations into one string that matches the location of those layers.

I recall this was going to work for you?  Is this the same project?
0 Kudos
LeoDonahue
Deactivated User
Tabs, radio buttons, it's your choice.  Whatever you feel like you can maintain (remember) 6 months after you stop working on this project.
0 Kudos
MichelleCouden1
Deactivated User
Yes, same project. I will look for the answer you guys gave me. Although, it should be different now that I'm going to use tabs correct? So, the program on each tab should be something like :
 Private Sub State_Change()
        If checkboxmanual = true then 
            openFileDialog.InitialDirectory = "K:\"
0 Kudos
MichelleCouden1
Deactivated User
Looked back through my posts. Belowzero helped me in december with the open shapefile code. That was the only help I got on the project. I opened this post for help on the checkbox code.
0 Kudos
LeoDonahue
Deactivated User
Yes, same project. I will look for the answer you guys gave me. Although, it should be different now that I'm going to use tabs correct? So, the program on each tab should be something like :
 Private Sub State_Change()
        If checkboxmanual = true then 
            openFileDialog.InitialDirectory = "K:\"


Well, in a way yes.

I thought you said that a user could select multiple stations.  Do you really want to make the user suffer through the openFileDialog for as many times as they have something checked on that tab?

And.. why not just add the layer programmatically, instead of presenting the open file dialog?  Did I miss something?
0 Kudos
LeoDonahue
Deactivated User
0 Kudos