473,800 Members | 2,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Load a form without blinking...

I am trying to load a form (load Me) without the form becoming visible. If
I try me.hide or me.visible = false, they load the form and the form blinks
before becoming invisible. Is there a way to load the form without it
becoming visible at all until I say me.visible = true?

Thanks.

Matthew Wells
MW****@NumberCr uncher.com
Jul 17 '05 #1
6 17075
Load Me?

I'd imagine this line of code is in the form's module, right?
This code is only get to run when the form HAS BEEN loaded. So, why load
itself again?

To load form but to showing it, you do

Dim myForm As TheForm

'Load an instance of TheForm into memory
'You can access the frm without showing it
Set myForm=New TheForm
myForm.Caption= "XXXXXXXXXXXXXX X"
'Do other things
'Show form
myForm.Show 'You will see the form's caption is changed to
"XXXXXXXXXXXXXX XXXX"

"Matthew Wells" <MW****@NumberC runcher.com> wrote in message
news:OE******** ***********@big news6.bellsouth .net...
I am trying to load a form (load Me) without the form becoming visible. If I try me.hide or me.visible = false, they load the form and the form blinks before becoming invisible. Is there a way to load the form without it
becoming visible at all until I say me.visible = true?

Thanks.

Matthew Wells
MW****@NumberCr uncher.com

Jul 17 '05 #2
Load Form1 will, perhaps not surprisingly, load form1. As the Load part
indicates, it loads, not shows. Do you have a Refresh statement or an
implicit Show statement somewhere in your code?

You do *not* have to use the Dim f as TheForm as suggested in another
response. Doing so in a non-MDI application is guaranteed to get you into
trouble down the road.

--

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.
"Matthew Wells" <MW****@NumberC runcher.com> wrote in message
news:OE******** ***********@big news6.bellsouth .net...
: I am trying to load a form (load Me) without the form becoming visible.
If
: I try me.hide or me.visible = false, they load the form and the form
blinks
: before becoming invisible. Is there a way to load the form without it
: becoming visible at all until I say me.visible = true?
:
: Thanks.
:
: Matthew Wells
: MW****@NumberCr uncher.com
:
:
Jul 17 '05 #3

"Matthew Wells" <MW****@NumberC runcher.com> wrote in message
news:OE******** ***********@big news6.bellsouth .net...
I am trying to load a form (load Me) without the form becoming visible. If I try me.hide or me.visible = false, they load the form and the form blinks before becoming invisible. Is there a way to load the form without it
becoming visible at all until I say me.visible = true?


You obviously can't load the form from itself. In order to do that the form
must have already been active (since your code is obviously executing) so
that's probably the blink you saw.

Instead of starting your code with a form, start your code in a module
"Main" from there you can issue the Load form command.

Do other things after the load command and when you're ready, just do
form.show

Just make sure that in the form load command, you don't have anything that
triggers a refresh because the code in this section is executed when the
form is loaded.


Jul 17 '05 #4
"Raoul Watson" <Wa*****@Intell igenCIA.com> wrote in message news:<KP******* *****@nwrdny03. gnilink.net>...
"Matthew Wells" <MW****@NumberC runcher.com> wrote in message
news:OE******** ***********@big news6.bellsouth .net...
I am trying to load a form (load Me) without the form becoming visible. If
I try me.hide or me.visible = false, they load the form and the form

blinks
before becoming invisible. Is there a way to load the form without it
becoming visible at all until I say me.visible = true?


You obviously can't load the form from itself. In order to do that the form
must have already been active (since your code is obviously executing) so
that's probably the blink you saw.


You can load the form from itself; start a new project and add a BAS
module and set the startup object to Sub Main and try this code:

' in the BAS module
Private Sub Main()
Dim f As Form1
Set f = New Form1
f.doit
Unload f
End Sub

' in the form
Public Sub doit()
Debug.Print "Doit start"
Load Me
Debug.Print "Doit Done"
End Sub

Private Sub Form_Initialize ()
Debug.Print "Init"
End Sub

Private Sub Form_Load()
Debug.Print "Load"
End Sub

Private Sub Form_QueryUnloa d(Cancel As Integer, UnloadMode As Integer)
Debug.Print "QueryUnloa d"
End Sub

Private Sub Form_Terminate( )
Debug.Print "Term"
End Sub

Private Sub Form_Unload(Can cel As Integer)
Debug.Print "Unload"
End Sub
Instead of starting your code with a form, start your code in a module
"Main" from there you can issue the Load form command.

Do other things after the load command and when you're ready, just do
form.show

Just make sure that in the form load command, you don't have anything that
triggers a refresh because the code in this section is executed when the
form is loaded.


that is probably the problem... something in Form_Load is causing the
form to be displayed.
Jul 17 '05 #5
Here's the exact problem. I want to position the controls BEFORE the form
becomes visible. The form is resizable so I have code in the Form_Resize
event. Loading the form by itself does not cause the blink, but after the
code in Fomr_Load finished, it steps into Form_Resize and that's what causes
the blink. I even have the form et to Visible=False in design view. I put
the code in Form_Resize in a sub and tried calling the sub while the form
was hidden - but when I do me.visible = true, the controls aren't moved.
It's very ugly to have it visible. BTW, it's an MID child form.

Any more ideas?
"Matthew Wells" <MW****@NumberC runcher.com> wrote in message
news:OE******** ***********@big news6.bellsouth .net...
I am trying to load a form (load Me) without the form becoming visible. If I try me.hide or me.visible = false, they load the form and the form blinks before becoming invisible. Is there a way to load the form without it
becoming visible at all until I say me.visible = true?

Thanks.

Matthew Wells
MW****@NumberCr uncher.com

Jul 17 '05 #6
"Matthew Wells" <MW****@NumberC runcher.com> wrote in message news:<O7******* *******@bignews 5.bellsouth.net >...
<cu>
BTW, it's an MID child form.


Check the 'AutoShowChildr en' property of the MDI parent
Jul 17 '05 #7

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

Similar topics

7
1867
by: Heath | last post by:
I was reading that it is considered bad form to require a browser to redraw the page after it has been loaded, ie image swaps or color changes using the pseudo-class a:active or a:hover, is is this the general concesus, or does common usage prevail?
8
2852
by: Hugo | last post by:
I am building a website. Now I want to put a couple of lines on my page which I want to blink. <blink> is not supported for shapes/lines and I want to decide myself if i want a line to blink. What do I mean: button1.onclick{ line1.blink(??)} button2.onclick{ line2.blink(??)}
5
2041
by: Markus | last post by:
Blinking control Perhaps my question is not exactly an Access question, but may somebody might give me an answer.i have a very important control on my report, called "Stockflow" and in case the goods in the warehouse do not correspond to the documents i want to have some special effect, either voise, or blinking, or anything of the kind.
2
5852
by: Sharon | last post by:
The ErrorProvider text is also blinking together with the icon. It’s making the reading of the error description very uncomfortable. Is there a way to prevent the text from blinking while the icon is still blinking? -- Regards Sharon G.
2
2065
by: Rich | last post by:
Can a vb.net form contain a subform? If yes, how is this done? Maybe I am going about my issue the wrong way. I start an asynchronous procedure from my main form - invoke a routine on a mainframe computer. Then I am polling every 10 seconds (timer1) to see if the external program has generated a data result set for my form to retrieve. In the meantime, on the same main form I have a series a little labels that blink on/off in a series...
2
2065
by: Ling | last post by:
Hi, I guessed this is a weird question but it really bothers me. I created a web page w/ asp.net, have a menu on the top and a listbox right below it. When I try to navigate the menu, the listbox blinks. Note that it only happens with IE. I don't have blinks in Firefox at all.
4
7335
by: Bob | last post by:
Hi, I have a pictureBox. What is the most efficient way to load an image (png) : FromFile or FromStream ? The picture Box is set to Visible = True or Visible = False at the run time. For the moment i use FromFile, but sometimes, i have an error saying that the file is all ready in use (can happen or not, and never at the same moment...) If i use FromStream, and if i set the Enabled property to false, if another
10
15335
by: sara | last post by:
Hi - I have been struggling with solution ideas for this now for almost 2 weeks, and have not been able to figure this out. I have a user who creates a Purchase Order (tblPOData). In some circumstances, this or another user must create an invoice to go with the PO (I know - that makes no sense, but this is the business case). I have the user go to a form to create the invoice:
5
8524
by: michels287 | last post by:
Right now I have a touchscreen with a virual keyboard. I would like to create arrow keys. If the user messed up the inputted text, he can move the blinking cursor left one space at a time between inputted characters to add a letter. Then a button to move the blinking cursor back to the end of the inputted text. Private Sub Left Arrow_Click() If Text1.SelStart Then Text1.SelStart = Text1.SelStart - 1 Text1.SetFocus End Sub Private...
0
10274
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
10251
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
10033
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
7576
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
6811
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
5469
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...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
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.