473,396 Members | 2,017 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.

DUMB Module question

RSH
I have create a simple module and a couple forms. I have it set to run the
module when the application starts. Several variables are set and then a
form object is instantiated and displayed. The problem is that the
application doesnt pause when the form displays...instead it simply quits
right after the form is displayed. Why doesn't it simply pause after the
form is displayed?

Module Code:
sub main()

Dim f1 As New Form1

f1.Show()

f1.TextBox1.Text = "Test Text To Display

Application.DoEvents()

end sub
Nov 21 '05 #1
3 1004

"RSH" <wa*************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have create a simple module and a couple forms. I have it set to run the
module when the application starts. Several variables are set and then a
form object is instantiated and displayed. The problem is that the
application doesnt pause when the form displays...instead it simply quits
right after the form is displayed. Why doesn't it simply pause after the
form is displayed?

Module Code:
sub main()

Dim f1 As New Form1

f1.Show()

f1.TextBox1.Text = "Test Text To Display

Application.DoEvents()

end sub


Sub Main()
Dim f1 As Form1 = New Form1()
f1.TextBox1.Text = "Test Text To Display"
Application.Run(f1)
End Sub

HTH :)

Mythran

Nov 21 '05 #2
"RSH" <wa*************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
the application doesnt pause when the form displays...


Make sure you use Application.Run(), not Form.Show() to get the
form up and running; this sets up a "Message Loop" for it to run
around in; without this, as you've seen, the application has no reason
to stay running.

HTH,
Phill W.
Nov 21 '05 #3
RSH
Thanks! As you might imagine this definitely worked!

I had a real tough time grasping the concept of a form as an object...and it
got real blurry when working with the codebehind of the form. I think i
like the conept of the modules running the show and leveraging the forms as
what they are...forms.
"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> wrote in message
news:dd*********@yarrow.open.ac.uk...
"RSH" <wa*************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
the application doesnt pause when the form displays...


Make sure you use Application.Run(), not Form.Show() to get the
form up and running; this sets up a "Message Loop" for it to run
around in; without this, as you've seen, the application has no reason
to stay running.

HTH,
Phill W.

Nov 21 '05 #4

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

Similar topics

16
by: squash | last post by:
a dumb question i had on my mind: Say you have a dynamically created web page . Isn't it more secure to write it in php since a visitor will not be able to tell it is dynamically created? But...
15
by: Good Man | last post by:
Hey there I have a dumb question.... Let's say i have a database full of 4000 people.... I select everything from the database by: $result = mysql_query("SELECT * FROM People");
4
by: Python Dunce | last post by:
I've run into an issue with glob and matching filenames with brackets '' in them. The problem comes when I'm using part of such a filename as the path I'm passing to glob. Here's a trimmed down...
13
by: PJ6 | last post by:
Are there any plans for broswers to support a real language client-side, and not just "cripple script"? Will we ever have the luxury of programming using Framework classes client-side some day? ...
2
by: Bill Nguyen | last post by:
I would like to add a new VB.NET project using the same folder being used by another project so that I can share several forms already creaded by the other project. However, .NET created a new...
10
by: sp | last post by:
I create an xml file in a text editor: <?xml version="1.0" encoding="utf-8"?> <elts> <elt id="1" class="c1">content1</elt> <elt id="2" class="c1">content2</elt> </elts> Then I load the file...
8
by: kbperry | last post by:
In Python, When using the default except (like following) try: some code that might blow up except: print "some error message"
20
by: James | last post by:
I am new to vb.net (I am an old vb6 programmer). I cannot figure out an easy way to watch variables. In vb6 all I did was right click and could chose to stop execution when a variable chances as...
4
by: theapeman | last post by:
Sorry to bore everyone with this question, which I'm sure is the equivalent of "Please help! What letter comes between C and E in the alphabet?" but seriously, if you really didn't know that, I don't...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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,...
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
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...
0
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...
0
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,...

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.