|
-
Jun 27th, 2011, 02:02 PM
#1
Thread Starter
Fanatic Member
wait for me.show to complete
I have a section of code in which I want to display a messagebox after a form is displayed... as the form loads. I used....
me.show
messagebox.show
If I don't use me.show first, the messagebox appears before the form is displayed. If I do use me.show first, the form appears, but is not always complete before the messagebox appears. Is there an easy way to poll the form to see if it is done displaying without using a timer?
Thanks.
-
Jun 27th, 2011, 02:11 PM
#2
Frenzied Member
Re: wait for me.show to complete
Did you try putting the messagebox in the form shown event?
also if you have code that runs in the form load event make sure you put the messagebox as the last line of code
-
Jun 27th, 2011, 02:28 PM
#3
Re: wait for me.show to complete
Put the messagebox code in the Shown event instead of the Load event.
-
Jun 27th, 2011, 02:46 PM
#4
Thread Starter
Fanatic Member
Re: wait for me.show to complete
Is there such an event in VB.NET 2003?
-
Jun 27th, 2011, 02:57 PM
#5
Re: wait for me.show to complete
I think so. I don't have it with me. 2003 is framework 2.0, right? Or is that 2005?
-
Jun 27th, 2011, 03:00 PM
#6
Re: wait for me.show to complete
 Originally Posted by rickford66
Is there such an event in VB.NET 2003?
No. The Form.Shown event wasn't available until .Net 2.0. However, you could use a combination of a boolean variable and Form.Activated event to achieve what you need.
Code:
'Class level boolean flag
Private formshown as Boolean = False
'Then in form.activated event handler, you do
If Me.formshown = False Then
Me.formshown = True
MessageBox.Show("your message here")
End If
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Jun 27th, 2011, 03:03 PM
#7
Re: wait for me.show to complete
Or upgrade, what possible reason do you have to stay on the obsolete framework?
-
Jun 27th, 2011, 03:10 PM
#8
Re: wait for me.show to complete
 Originally Posted by ForumAccount
Or upgrade, what possible reason do you have to stay on the obsolete framework?
Good point. Upgrading is easy and you will definitely appreciate the new features.
-
Jun 27th, 2011, 03:26 PM
#9
Re: wait for me.show to complete
 Originally Posted by ForumAccount
Or upgrade, what possible reason do you have to stay on the obsolete framework?
IT support guys and programmers do not always work with each others in harmony... For example, in a large corporation where my wife works, a simple request to the IT folks such as unblocking a work related website takes 3 months. Now imagine asking them to install .net 2.0 on a few dozen thousands PC's...
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
-
Jun 27th, 2011, 03:27 PM
#10
Re: wait for me.show to complete
 Originally Posted by stanav
IT support guys and programmers do not always work with each others in harmony... For example, in a large corporation where my wife works, a simple request to the IT folks such as unblocking a work related website takes 3 months. Now imagine asking them to install .net 2.0 on a few dozen thousands PC's...
Better send that request in now!
-
Jun 28th, 2011, 08:32 AM
#11
Thread Starter
Fanatic Member
Re: wait for me.show to complete
I work for a very small_company (~15), so upgrading to the newest framework would be easy in that sense. The reason is that I'm the only EE/Programmer here and I'm a busy guy. I'm not sure if I want to deal with the headache of converting our programs over to the newest rev.... actually, I don't know how much headache it will actually be. Also, some of our apps are running on machines that run W98, so that might also be an issue. I haven't investigated it yet.
Last edited by rickford66; Jun 28th, 2011 at 08:39 AM.
-
Jun 28th, 2011, 08:49 AM
#12
Re: wait for me.show to complete
The change from 2003 to 2005 is larger than changes between any other two. Still, that is largely due to a lot of new features added in framework 2.0, which would be good to get.
Fortunately, you don't really have to worry about it. You can have multiple versions of VS installed on the same computer at the same time, and they will all work fine together. Therefore, you could install 2010, make a copy of the 2003 project, try out the copy in 2010 (once you upgrade it can be a real pain to go back, which is why a copy would be a good idea to start with), and decide how difficult the change would actually be.
My usual boring signature: Nothing
 
-
Jun 28th, 2011, 10:17 AM
#13
Re: wait for me.show to complete
also, if the computers are up-to-date, they may have the required framework(s) installed.
"Ok, my response to that is pending a Google search" - Bucky Katt.
"There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
"Before you can 'think outside the box' you need to understand where the box is."
-
Jun 29th, 2011, 02:06 PM
#14
Thread Starter
Fanatic Member
Re: wait for me.show to complete
I installed VB.NET 2010 Express and converted the program. It gave me many errors but they are all fixed now. Apparently I'm sloppy with my constant declarations because I had a number of them that had to be cleaned up. A lesson learned. Anyway, I loaded the installer and converted that too, but it doesn't want to work. In the solution explorer, it says "application is not installed". Can VB.NET 2010 Express make executables or do I need to buy a copy?
-
Jun 29th, 2011, 02:56 PM
#15
Thread Starter
Fanatic Member
Re: wait for me.show to complete
Apparently, a separate installer project is not required anymore. Checking into this one-click publish thing.
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
|