Checkbox Status

ceaser

Active Member
Licensed User
Hi All

I wonder if somebody can help me:sign0085:

In my "Field" module I have at the bottom of the screen 3 check boxes. The first checkbox is for a Level, the 2nd checkbox is for a Total Station and the 3rd checkbox is for a GPS. This way the surveyor can tap on the checkbox corresponding to the instrument that he or she is using.

Now when one taps on a checkbox, the serial port gets closed (if it was open) and then opened again with the settings for the particular selected intrument.

Now when the program loads another form in the same module (say when one wants to set out batterboards, do a tachy survey, set out profile pegs, etc) and the form closes (when you tap on the "Exit" button), the "Checkbox_click" event occurs. Then the program closes the port and opens it again. This is nogood!!:BangHead:

This does not happen on the PC, but on on the handheld.

Any suggestions or is this a bug?

Thanks
ceaser
 

Zenerdiode

Active Member
Licensed User
Purely guessing, it sounds like the focus is being directed to the checkbox - which forces the sub to re-run. You may have to alter the tab order of the cotrols so the focus does not get left on the checkbox.

It also sounds as though you should be using a radio button - rather than a checkbox; as you should only be able to select one instrument at a time I presume that by using a checkbox you have to uncheck an instrument first then select another. Or do you uncheck in code? Or can you have more than one instrument (GPS, Total etc.) connected at the same time?

See also Unwanted Click Event
 

Zenerdiode

Active Member
Licensed User
I meant Radiobtns and not checkboxes!:sign0161:

In that case it is very much the same as the 'Unwanted Click Event' I directed you to above (which just so happens to be my first ever post on the forum!!)

Quoting Erel:
I'm not sure if it is a bug in the .Net Framework or an intended behavior, but when a RadioBtn is focused it also gets selected (or clicked).
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…