473,396 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Start a method after form shown on screen

Where or what is the proper way to get a procedure to start after the form
is shown on the screen? I figured out if you put it in Load it will start
before the form is shown and the form will not show until the procedure is
complete... so whats the best way to get something to start after the form
is loaded and visible? thanks!
Sep 10 '07 #1
8 7125
Smokey,

Form_Activated()

--
Newbie Coder
(It's just a name)
"Smokey Grindel" <no****@nospam.comwrote in message
news:%2******************@TK2MSFTNGP04.phx.gbl...
Where or what is the proper way to get a procedure to start after the form
is shown on the screen? I figured out if you put it in Load it will start
before the form is shown and the form will not show until the procedure is
complete... so whats the best way to get something to start after the form
is loaded and visible? thanks!


Sep 10 '07 #2
Smokey,

Starting with .Net 2.0, you can use the form's Shown event.

Kerry Moorman
"Smokey Grindel" wrote:
Where or what is the proper way to get a procedure to start after the form
is shown on the screen? I figured out if you put it in Load it will start
before the form is shown and the form will not show until the procedure is
complete... so whats the best way to get something to start after the form
is loaded and visible? thanks!
Sep 10 '07 #3
ah awesome, the activated one I was staying away from because every time it
got focus it reactivated the form it seemed like...

"Kerry Moorman" <Ke**********@discussions.microsoft.comwrote in message
news:51**********************************@microsof t.com...
Smokey,

Starting with .Net 2.0, you can use the form's Shown event.

Kerry Moorman
"Smokey Grindel" wrote:
>Where or what is the proper way to get a procedure to start after the
form
is shown on the screen? I figured out if you put it in Load it will start
before the form is shown and the form will not show until the procedure
is
complete... so whats the best way to get something to start after the
form
is loaded and visible? thanks!

Sep 10 '07 #4
JB
On 10 Sep, 22:39, "Smokey Grindel" <nos...@nospam.comwrote:
ah awesome, the activated one I was staying away from because every time it
got focus it reactivated the form it seemed like...

"Kerry Moorman" <KerryMoor...@discussions.microsoft.comwrote in message

news:51**********************************@microsof t.com...
Smokey,
Starting with .Net 2.0, you can use the form's Shown event.
Kerry Moorman
"Smokey Grindel" wrote:
Where or what is the proper way to get a procedure to start after the
form
is shown on the screen? I figured out if you put it in Load it will start
before the form is shown and the form will not show until the procedure
is
complete... so whats the best way to get something to start after the
form
is loaded and visible? thanks!
Hi Smokey,

You could use a BackgroundWorker class. See help on
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_fxmclictl/
html/5b56e2aa-dc05-444f-930c-2d7b23f9ad5b.htm

Or alternatively, you could start a timer at the end of the form Load
event and perform your job the first time the timer tick is called.
This is not a true background solution though.

JB

Sep 11 '07 #5
Smokey,

If I need to use the Activated method I usually create a boolean value so not to
use it from keep firing:

Example:

Dim blnHasFired As Boolean = False

Then use something like this:

If blnHasFired = False Then
' Do Something Here
blnHasFired = True
Exit Sub
End If

--
Newbie Coder
(It's just a name)

"Smokey Grindel" <no****@nospam.comwrote in message
news:%2******************@TK2MSFTNGP03.phx.gbl...
ah awesome, the activated one I was staying away from because every time it
got focus it reactivated the form it seemed like...

"Kerry Moorman" <Ke**********@discussions.microsoft.comwrote in message
news:51**********************************@microsof t.com...
Smokey,

Starting with .Net 2.0, you can use the form's Shown event.

Kerry Moorman
"Smokey Grindel" wrote:
Where or what is the proper way to get a procedure to start after the
form
is shown on the screen? I figured out if you put it in Load it will start
before the form is shown and the form will not show until the procedure
is
complete... so whats the best way to get something to start after the
form
is loaded and visible? thanks!


Sep 11 '07 #6

"Smokey Grindel" <no****@nospam.comwrote in message
news:%2******************@TK2MSFTNGP04.phx.gbl...
Where or what is the proper way to get a procedure to start after the form
is shown on the screen? I figured out if you put it in Load it will start
before the form is shown and the form will not show until the procedure is
complete... so whats the best way to get something to start after the form
is loaded and visible? thanks!
My (probably rough!) solution to this is to force the form to show before
doing anything...

So in form_load, I put

{
Form1.Show();
Application.DoEvents();

Do stuff.... ;
}

Sep 11 '07 #7
James,

I thin you got lost a little as this is a VB.NET newsgroup not C#

--
Newbie Coder
(It's just a name)
"JamesB" <ja***@somewhere.com.net.com.netwrote in message
news:46***********************@news.zen.co.uk...
>
"Smokey Grindel" <no****@nospam.comwrote in message
news:%2******************@TK2MSFTNGP04.phx.gbl...
Where or what is the proper way to get a procedure to start after the form
is shown on the screen? I figured out if you put it in Load it will start
before the form is shown and the form will not show until the procedure is
complete... so whats the best way to get something to start after the form
is loaded and visible? thanks!

My (probably rough!) solution to this is to force the form to show before
doing anything...

So in form_load, I put

{
Form1.Show();
Application.DoEvents();

Do stuff.... ;
}

Sep 11 '07 #8

"Newbie Coder" <ne*********@spammeplease.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
James,

I thin you got lost a little as this is a VB.NET newsgroup not C#
So I did! Although the logic is presumably still applicable?

Sep 13 '07 #9

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

Similar topics

24
by: el_roachmeister | last post by:
Is there a way to make a text link post to a form without passing all the parameters in the url? The urls tend to get very long and messy. I often wonder if there is a limit to how long they can...
18
by: Darryl Kerkeslager | last post by:
I don't do much with subforms - in fact I've deliberately avoided them - but .... I have a tab control that will contain several subforms, each bound to a separate table, and each table/subform...
11
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that...
10
by: Phil | last post by:
Hello Can anybody tell me which events are fired immediately after a form is displayed i.e. appears on screen? Ta Phil
4
by: Philip Wagenaar | last post by:
I have made a form with a tab that containts groupboxes and those contain checkboxes. When I run the application sometimes the outlining for some groupboxes are not shown, if I switch tabs and...
3
by: afr0ninja | last post by:
Hello! I'm currently working on a form that has several input fields and a subform. What I'm trying to accomplish is that when I first open the form I'd like to have the input fields displayed...
4
by: Martin H. | last post by:
Hi, I'm working on a DLL which I want to make available for download (when it's ready). However, since I want to make a few $$, I want that the About dialog of the DLL is shown each time the...
6
by: Steve | last post by:
Hi All I have an on-screen keyboard within a POS program I have written in VB.net 2005, for touch screen computers I have it set to 'always on top' so the user can move the cursor to...
0
Shashi Sadasivan
by: Shashi Sadasivan | last post by:
Hi All, I will start working on a form soon which runs as an mdi container (in the main screen) However there is this "new" requirement, there will be 4 screens, and one of the features of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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...

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.