|
-
Jun 12th, 2002, 01:00 PM
#1
Thread Starter
Registered User
showdialog
I am having trouble with the showdialog. I have a Main form, when you hit the button, it then loads a form by this method
VB Code:
HForm.ShowDialog()
System.Windows.Forms.Application.DoEvents()
but, then i have a next button on the Hform which does the following:
VB Code:
HForm.Hide()
System.Windows.Forms.Application.DoEvents()
TravelForm.ShowDialog()
System.Windows.Forms.Application.DoEvents()
now, the travelform is not becoming modal over the mainform...
does anyone have an idea of what might be wrong? thanks...
-
Jun 12th, 2002, 01:16 PM
#2
it might be the doevents
why are you using them anyway?
-
Jun 12th, 2002, 01:36 PM
#3
Thread Starter
Registered User
actually, the problem is a little weird, because, when the HForm displays over the mainform, with the first showdialog event, it is modal in that when you minimize, both forms minimize, but, when you HForm.hide, then do a travelform.showdialog, i think that statment is putting the modal form over the hidden form of hform. the following code seemed to have fixed the problem..
VB Code:
HForm.Hide()
HForm.TopMost = False
System.Windows.Forms.Application.DoEvents()
TravelForm.ShowDialog()
TravelForm.TopMost = True
System.Windows.Forms.Application.DoEvents()
thanks,
jeff
-
Jun 12th, 2002, 01:40 PM
#4
Thread Starter
Registered User
in response to the doEvents, i use them because with each input, it effects what is displayed on the next form. so in the load subroutine, of the next form, i have to enable things, disable things, based on the previous events. if you don't use a doevents, after the showdialog, the program attempts to show the form before it is completely loaded. it looks alot better when you have the doevents.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|