473,769 Members | 4,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Looking for an event that fires only once on startup

LDD
After upgrading sucessfully to VB.Net... WooHoo!!! It was a slow process,
but in the end it seemed to have worked out well.

I've noticed the the form_active (VB6) is no longer available. There is the
Form_Activated available.

I have built a work around, but everytime the main form for the app is
clicked, the form_activated event fires.

Is there the equivalent to the form_active in VB6. Where the code only
executed on startup? I was hoping to find like a form_init or something
along those lines.

Does anyone know if there is an event that fires only on the intital
startup?

thanks folks

LDD
Nov 21 '05 #1
3 1268
"LDD" <la************ ***@gmail.com> schrieb:
Does anyone know if there is an event that fires only on the intital
startup?


\\\
Private Sub Form1_Activated ( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles MyBase.Activate d
Static IsActivated As Boolean
If Not IsActivated Then
IsActivated = True
...
End If
End Sub
///

In .NET 2.0 Windows Forms forms have a 'Shown' event.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #2
dont you mean the _Load event?

the event which fires when the form is loaded, for exampe:

if your form name is frmMain, then your _Load even handler would look
like so:

Private Sub frmMain_Load(By Val eventSender As System.Object, _
ByVal eventArgs As System.EventArg s) Handles
MyBase.Load

End Sub

Nov 21 '05 #3
you could also set the program to startup to a Public Shared Sub Main sub
which weill only fire when the form loads
Nov 21 '05 #4

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

Similar topics

0
2461
by: dlieu | last post by:
I've found an odd situation in where the Load event of the active form fires (after the Unload event) when Access is closed. I am able to reproduce this situation in Access 2002 SP3 and Access 2003 on computers running WinXP. This does not appear to happen in Access 2000 on a computer with Win2000. This only seems to happen if there is a hidden form also loaded and, so far, I'm only able to reproduce this if the forms are loaded through...
6
2881
by: Dan | last post by:
I've created a pocketpc app which has a startup form containing a listview. The form creates an object which in turn creates a System.Threading.Timer. It keeps track of the Timer state using a TimerState object similar to the example in the System.Threading.Timer documentation. The method which handles the timer events, among other things, periodically calls a method in this TimerState object which raises an event to the startup form,...
19
3493
by: Heidi Hundåla | last post by:
Hi ! I have a Wep App in C#. Page_Unload fires after Page_Load, and it seems totally unreasonable when you want to use this event when you _leave_ the page. In my project we wanted to use the Page_Unload - event to clean up the Session variables, but when it turns out that it fires before the end, it screws up the code, and
1
2651
by: Bill Manring | last post by:
The startup page for my ASP.NET application is an HTML frames page with two frames. This seems to cause the Session_Start event in the Global.asax file to fire twice. When I change the startup page to an ordinary aspx page, the event only fires once. I would like to run some concurrent license checking code when the Session_Start event fires, so I either need to figure out how to stop it from firing twice or to figure aout a way to...
3
1477
by: Dpage | last post by:
Hello, I'm trying to allow users to drag a file (in this case a crystal report .rpt file) onto my application's icon and have that drop event open my application and open the report in the application. Currently I can use the drop event in the reportviewer to be able to drag the .rpt into my application while it's open.... that works great. But I can't get it to work when the application is not open. Basically I can't find the event...
6
8778
by: Joseph Geretz | last post by:
I'm porting a C# Outlook Addin originally engineered as a COM Addin over to use VSTO. I've gotten this to the point where my VSTO Addin installs its Menu items and Toolbar buttons when Outlook launches. I've wired up my event handler to each Menu item and toolbar button. (I use the same Event handler and I use the Tag property which is different for every Menu Item and Toolbar buton to determine which menu or button is being clicked and to...
3
3591
by: Techsatish | last post by:
how to make a mouseup event called only once during a double click event? here double click is made on a tree node in a tree control. I have the code inside mouseup event....in runtime the mouseup is called twice for the mouse double click over the selected tree node. I want mouseup event to be called onece Any ideas?
3
1474
by: Drex10 | last post by:
I have an event that occurs within a user control. The event is for a dropdownlist within the user control which fires when the selected item changes. This user control is created dynamicaly inside another user control. There are other user controls created within the same container control, however once the problem control event fires once it fires again whith any other event fired on the page. Any ideas???
8
5131
by: ApexData | last post by:
I'm using the OnKeyDown event in hopes of capturing a key being held down during the initial startup of my application. Does anyone know, at what point the OnKeyDown event fires? I checked to see if the key would be captured in the OnOpen and OnLoad or Initial OnCurrent event, but this does not seem to be the case. Can I capture a key in these events? Public CkOnOpenKey As Boolean CkOnOpenKey = True 'Placed in the OnOpen event
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10216
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...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
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
9865
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...
1
7413
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
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2815
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.