Some fiddling and I seem to have gotten around the problem I experienced earlier where I had to click on Form1 after "going back." This line took care of it (look for the @@@@@):
Dim Form2Showing Sub mnuForm1Next_Click 'Show Form2 with OK Form2_Show Form1_Hide ShowOKButton True 'Set Close button to OK Form2Showing = True End Sub Sub Output_Close 'If showing Form2 go back to Form1 If Form2Showing Then Form1_Show Form2_Hide ShowOKButton False 'Set Close button to [X] Form1.SetFocus '@@@@@ Form2Showing = False End If End Sub Your comments still make me worry though George. You certainly know what NSB/CE is doing under the covers better than I ever will. I'll try more testing to see if this will be robust enough for me. If not I'll have to do something like you suggested instead. Thanks. Bob --- In [email protected], "michiman56" <rriemer...@...> wrote: > > I understand what you're saying, but maybe I'm just going about things the > wrong way? > > When your main program opens a "dialog" one of the ways these dialogs > commonly get closed is by clicking the [OK] button. > > You can see a simple example of this by starting Windows Media player, then > clicking Menu|Library... to bring up the Library management dialog. This > dialog changes the Close button to [OK] mode, and clicking on it takes you > back to the main Media Player window. > > I could easily use another button labeled something like "Back" but the UI > Guidelines suggest Back and Next are meant for things like Wizard or Tree > navigation, not for exiting dialogs. I'd rather avoid making my UI > non-standard where I can avoid it. > > I'm probably running up against the different way NSB/CE is handling the > "Form" metaphor behind the scenes. > > Perhaps I could try calling SHDoneButton() directly: > > http://msdn.microsoft.com/en-us/library/aa930127.aspx > > ... however this may be almost exactly what ShowOKButton is doing anyway. By > rights this ought to be a property of a Form according to the MSDN docs: > > "Whenever the foreground window changes, the shell checks the style bits of > the window to determine if the OK button should appear in the navigation bar." > > I'll consider alternatives though. > > Thanks! > > Bob > > --- In [email protected], "George Henne" <gh@> wrote: > > > > The OK button is "owned" by the operating system. Asking it to change > > its behaviour in the middle of running the app could lead to undefined > > conditions. > > > > I usually set it the way I need when the program starts, then don't mess > > with it. I'll use a button like "Back" to go to the previous form. -- You received this message because you are subscribed to the Google Groups "nsb-ce" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nsb-ce?hl=en.
