Spencer, This worked well. Sometimes "rigging" the application is the only way to go. You'd think MB would allow you to set the focus on any control you wanted with the "active" keywrd.
-----Original Message----- From: Spencer Simpson [mailto:[EMAIL PROTECTED] Sent: Monday, August 21, 2006 4:24 PM To: 'Greg Goodall'; [email protected] Subject: RE: [MI-L] Set Focus on PopupMenu Control in a Dialog If your dialog has even one EditText control that is enabled, MapInfo will select one of those to be the active control. You have no choice. However, it's possible to work around this limitation by specifying all of the EditText controls with Disable. In that case, the first of the non-disabled controls in the dialog will be the active one. If you want an EditText to be enabled when the dialog appears, you can enable it in the dialog handler; this will not affect which control is active (that is, unless you use the "Active" clause of Alter Control). In the following code, the RadioGroup will be the active control, since it is the first control that appears in the dialog which is active by default. Notice the "position" clauses, which make the radio group appear further down in the dialog. ' compiled with MB8.5 / run with MI 8.5 declare sub main declare sub setupdlg sub main dialog title "Test" calling setupdlg control StaticText title "Edit:" position 4, 6 control EditText value "edit text" ID 1 disable position 30, 4 control StaticText title "Radio:" position 4, 38 control RadioGRoup title "first option;second option;third option" position 30, 36 control StaticText title "Popup:" position 4, 22 control PopupMenu title "first option;second option;third option" position 30, 20 control OKButton title "OK" control CancelButton title "Done" end sub sub setupdlg alter control 1 enable end sub ________________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Greg Goodall Sent: Monday, August 21, 2006 1:31 PM To: [email protected] Subject: [MI-L] Set Focus on PopupMenu Control in a Dialog I have a Dialog that contains several types of controls (StaticText, PopupMenu, EditText, RadioGroup and Buttons) and I would like to specify which control has the initial focus when the Dialog displays. Currently when the Dialog displays, the focus is placed on the first EditText control. I want the focus to be placed on a PopupMenu control instead. The Controls are defined in the following order StaticText PopupMenu EditText So I would think that the PopupMenu would be get the initial focus according to the Help information below. Greg Goodall Data Management Marketing Project Manager / Senior Systems Analyst 321-725-8081 [EMAIL PROTECTED] _______________________________________________ MapInfo-L mailing list [email protected] http://www.directionsmag.com/mailman/listinfo/mapinfo-l
