473,624 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why doesn't load event fire when i use form.showialog( )?

I have a login form which I want to display with the showdialog method. When I do that the event handler for the load event does not run. If I use the show method the load event handler runs perfectly. I can't find any documentation regarding the load event not firing when a form is displayed using the showdialog method.
Nov 20 '05 #1
5 4927
Engineerik,
I use ShowDialog and my Load event fires.

Can you attach a 15 to 20 line sample program that demostrates the problem.

Hope this helps
Jay

"Engineerik " <En********@dis cussions.micros oft.com> wrote in message
news:54******** *************** ***********@mic rosoft.com...
I have a login form which I want to display with the showdialog method.

When I do that the event handler for the load event does not run. If I use
the show method the load event handler runs perfectly. I can't find any
documentation regarding the load event not firing when a form is displayed
using the showdialog method.
Nov 20 '05 #2
Jay,
I have a breakpoint in the load event handler on the line that writes to the console. That breakpoint is not encountered if the showdialog method is used but it is when the show method is used.

You can see from the console output that the write does not occur after the showdialog method is used.

I appreciate any suggestions you might have on this.

"Jay B. Harlow [MVP - Outlook]" wrote:
Engineerik,
I use ShowDialog and my Load event fires.

Can you attach a 15 to 20 line sample program that demostrates the problem.

Hope this helps
Jay

Here is a code snippet and the console output I got.
The following code is in sub main() which is the startup object
Friend WithEvents frmSplash As New BInitSplash()
Friend WithEvents frmMain As New frmBInitMain()
[snip]
'Display the Splash Form
Console.WriteLi ne("frmSplash.s howdialog")
bContinue = frmSplash.ShowD ialog()

'Display without showmodal
Console.WriteLi ne("Now frmsplash.show" )
frmSplash.Show( )

Here is the load event handler of the form:
Private Sub BInitSplash_Loa d(ByVal sender As Object, ByVal e As System.EventArg s) Handles MyBase.Load
Console.WriteLi ne(Me.Name & " load event is firing.")
'Fill in controls as necessary
cbRemember.Chec ked = bRemember

If bRemember Then
tbUserName.Text = sUserName
tbPassword.Text = sPassword
tbDatabaseName. Text = sDatabaseName
tbServerLocatio n.Text = sServerLocation
End If

End Sub

Here is the console output:
[snip]
'BInitPro.exe': Loaded 'c:\windows\ass embly\gac\micro soft.visualbasi c\7.0.3300.0__b 03f5f7f11d50a3a \microsoft.visu albasic.dll', No symbols loaded.
frmSplash.showd ialog
Now frmsplash.show
BInitSplash load event is firing.
'BInitPro.exe': Loaded 'c:\erix\work\b initpro\bin\int erop.scripting. dll', No symbols loaded.
[snip]

Nov 20 '05 #3
I just created a new project from scratch that just displays a blank form and the load event is firing for both the show and showdialog methods.
I don't know how I managed to mangle the project I was working on but since I wasn't that deep into it I am going to start over with a clean slate and see what happens.

I will report more on this thread after I recreate the project from scratch.

Regards,
Engineerik

"Engineerik " wrote:
Jay,
I have a breakpoint in the load event handler on the line that writes to the console. That breakpoint is not encountered if the showdialog method is used but it is when the show method is used.

You can see from the console output that the write does not occur after the showdialog method is used.

I appreciate any suggestions you might have on this.

"Jay B. Harlow [MVP - Outlook]" wrote:
Engineerik,
I use ShowDialog and my Load event fires.

Can you attach a 15 to 20 line sample program that demostrates the problem.

Hope this helps
Jay

Here is a code snippet and the console output I got.
The following code is in sub main() which is the startup object
Friend WithEvents frmSplash As New BInitSplash()
Friend WithEvents frmMain As New frmBInitMain()
[snip]
'Display the Splash Form
Console.WriteLi ne("frmSplash.s howdialog")
bContinue = frmSplash.ShowD ialog()

'Display without showmodal
Console.WriteLi ne("Now frmsplash.show" )
frmSplash.Show( )

Here is the load event handler of the form:
Private Sub BInitSplash_Loa d(ByVal sender As Object, ByVal e As System.EventArg s) Handles MyBase.Load
Console.WriteLi ne(Me.Name & " load event is firing.")
'Fill in controls as necessary
cbRemember.Chec ked = bRemember

If bRemember Then
tbUserName.Text = sUserName
tbPassword.Text = sPassword
tbDatabaseName. Text = sDatabaseName
tbServerLocatio n.Text = sServerLocation
End If

End Sub

Here is the console output:
[snip]
'BInitPro.exe': Loaded 'c:\windows\ass embly\gac\micro soft.visualbasi c\7.0.3300.0__b 03f5f7f11d50a3a \microsoft.visu albasic.dll', No symbols loaded.
frmSplash.showd ialog
Now frmsplash.show
BInitSplash load event is firing.
'BInitPro.exe': Loaded 'c:\erix\work\b initpro\bin\int erop.scripting. dll', No symbols loaded.
[snip]

Nov 20 '05 #4
It sounds like your "Form_Load" proc in your code lost its "Handles
MyBase.Load" directive at the end. They're easy to miss.

"Engineerik " <En********@dis cussions.micros oft.com> wrote in message
news:56******** *************** ***********@mic rosoft.com...
I just created a new project from scratch that just displays a blank form and the load event is firing for both the show and showdialog methods. I don't know how I managed to mangle the project I was working on but since I wasn't that deep into it I am going to start over with a clean slate
and see what happens.
I will report more on this thread after I recreate the project from scratch.
Regards,
Engineerik

"Engineerik " wrote:
Jay,
I have a breakpoint in the load event handler on the line that writes to the console. That breakpoint is not encountered if the showdialog method is
used but it is when the show method is used.
You can see from the console output that the write does not occur after the showdialog method is used.
I appreciate any suggestions you might have on this.

"Jay B. Harlow [MVP - Outlook]" wrote:
Engineerik,
I use ShowDialog and my Load event fires.

Can you attach a 15 to 20 line sample program that demostrates the problem.
Hope this helps
Jay

Here is a code snippet and the console output I got.
The following code is in sub main() which is the startup object
Friend WithEvents frmSplash As New BInitSplash()
Friend WithEvents frmMain As New frmBInitMain()
[snip]
'Display the Splash Form
Console.WriteLi ne("frmSplash.s howdialog")
bContinue = frmSplash.ShowD ialog()

'Display without showmodal
Console.WriteLi ne("Now frmsplash.show" )
frmSplash.Show( )

Here is the load event handler of the form:
Private Sub BInitSplash_Loa d(ByVal sender As Object, ByVal e As System.EventArg s) Handles MyBase.Load Console.WriteLi ne(Me.Name & " load event is firing.")
'Fill in controls as necessary
cbRemember.Chec ked = bRemember

If bRemember Then
tbUserName.Text = sUserName
tbPassword.Text = sPassword
tbDatabaseName. Text = sDatabaseName
tbServerLocatio n.Text = sServerLocation
End If

End Sub

Here is the console output:
[snip]
'BInitPro.exe': Loaded 'c:\windows\ass embly\gac\micro soft.visualbasi c\7.0.3300.0__b 03f5f7f11d50a3a \
microsoft.visua lbasic.dll', No symbols loaded. frmSplash.showd ialog
Now frmsplash.show
BInitSplash load event is firing.
'BInitPro.exe': Loaded 'c:\erix\work\b initpro\bin\int erop.scripting. dll', No symbols loaded. [snip]

Nov 20 '05 #5
After reading one of your latter posts, I see that's not your problem. Sorry
for that.
Though I'm curious about the
"'c:\erix\work\ binitpro\bin\in terop.scripting .dll', No symbols loaded." Is
that library standard fare? I've seen some strange (similar) "non-errors"
happen with interop.

<cm****@nospam. com> wrote in message
news:ef******** ******@tk2msftn gp13.phx.gbl...
It sounds like your "Form_Load" proc in your code lost its "Handles
MyBase.Load" directive at the end. They're easy to miss.

"Engineerik " <En********@dis cussions.micros oft.com> wrote in message
news:56******** *************** ***********@mic rosoft.com...
I just created a new project from scratch that just displays a blank form
and the load event is firing for both the show and showdialog methods.
I don't know how I managed to mangle the project I was working on but since I wasn't that deep into it I am going to start over with a clean

slate and see what happens.

I will report more on this thread after I recreate the project from scratch.

Regards,
Engineerik

"Engineerik " wrote:
Jay,
I have a breakpoint in the load event handler on the line that writes

to the console. That breakpoint is not encountered if the showdialog method is used but it is when the show method is used.
You can see from the console output that the write does not occur
after
the showdialog method is used.
I appreciate any suggestions you might have on this.

"Jay B. Harlow [MVP - Outlook]" wrote:

> Engineerik,
> I use ShowDialog and my Load event fires.
>
> Can you attach a 15 to 20 line sample program that demostrates the problem. >
> Hope this helps
> Jay
>
Here is a code snippet and the console output I got.
The following code is in sub main() which is the startup object
Friend WithEvents frmSplash As New BInitSplash()
Friend WithEvents frmMain As New frmBInitMain()
[snip]
'Display the Splash Form
Console.WriteLi ne("frmSplash.s howdialog")
bContinue = frmSplash.ShowD ialog()

'Display without showmodal
Console.WriteLi ne("Now frmsplash.show" )
frmSplash.Show( )

Here is the load event handler of the form:
Private Sub BInitSplash_Loa d(ByVal sender As Object, ByVal e As System.EventArg s) Handles MyBase.Load Console.WriteLi ne(Me.Name & " load event is firing.")
'Fill in controls as necessary
cbRemember.Chec ked = bRemember

If bRemember Then
tbUserName.Text = sUserName
tbPassword.Text = sPassword
tbDatabaseName. Text = sDatabaseName
tbServerLocatio n.Text = sServerLocation
End If

End Sub

Here is the console output:
[snip]
'BInitPro.exe': Loaded 'c:\windows\ass embly\gac\micro soft.visualbasi c\7.0.3300.0__b 03f5f7f11d50a3a \ microsoft.visua lbasic.dll', No symbols loaded. frmSplash.showd ialog
Now frmsplash.show
BInitSplash load event is firing.
'BInitPro.exe': Loaded 'c:\erix\work\b initpro\bin\int erop.scripting. dll', No symbols loaded. [snip]


Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2569
by: MGFoster | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Access 2002 & 2003. Windows XP Professional O/S. According to the Access Help article "ApplyFilter Event" the "...ApplyFilter event occurs when the user does one of the following:" "Filter menu in the Filter window, or clicks Apply Filter on the toolbar...." Yes, the event fires when this happens.
6
2202
by: Shimon Sim | last post by:
I have Panel control on the page. I am handling Init event for it. It doesn't seem to fire at all. Why? Thank you Shimon.
0
1875
by: Dean Slindee | last post by:
My project has a main form (frmMain, the startup object for the project) and several other "child" forms that are painted within a large panel on frmMain. In each form's Form_Load event, a Weak Reference for that form is loaded into a global Hash table, like this: Dim wr As WeakReference = New WeakReference(Me, False) If Not hashTable.Contains(cfrmMain) Then
12
4280
by: Dean Slindee | last post by:
My project has a main form (frmMain, the startup object for the project) and several other "child" forms that are painted within a large panel on frmMain. In each form's Form_Load event, a Weak Reference for that form is loaded into a global Hash table, like this: Dim wr As WeakReference = New WeakReference(Me, False) If Not hashTable.Contains(cfrmMain) Then
4
3479
by: Rob Richardson | last post by:
Greetings! I have a form with a listview, a menu, and a few text boxes, labels and command buttons. I want to resize the listview when the form is resized to that the widths of the spaces between the borders of the listview and the borders of the form remain constant. I am finding this to be unexpectedly hard. For one thing, I initialized some values in the form's Load event, and I'm doing the control resizing in the form's Resize...
3
2726
by: Dennis | last post by:
I have the following code for showing a form: dim frm as new myForm frm.ShowDialog (The Form Load Event is fired then I hide the form using Me.Hide when the X in the UR corner is clicked). 'Do something in code frm.ShowDialog (The Form Load Event fires again)
2
2375
by: Chu | last post by:
Thanks everyone for taking a moment to read this. I've got a page where I use a LinkButton and I wire up a dynamic event to the button. When the user clicks the button, the event is fired as expected. In the event code for that button, a new LinkButton is added to the page and is wired up to yet a different event, however when clicked, the page is posted back but the event is not triggered. I'm assuming it has something to do with the...
0
2091
by: Managed Code | last post by:
Hello All, Here is my issue and thanks in advance for any assistance. I have a base page with a dropdownlist that fires an event with the selected index. The content page catches the event and sets a connection string to the database. The content page has a simple gridview that should show records from the selected database. Initial content page displays data from correct place. first change of dropdownlist correctly updates content...
2
3909
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite well, so at times it is tempting just to port parts of it over mostly as-is. In fact, one MSDN article I read suggested using straight HTML wherever possible to make the app more efficient and less resource demanding. On one page there are 2...
0
8675
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8334
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6108
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2604
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.