473,831 Members | 2,288 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automatically executing a subroutine when a form loads


I have a form that displays a time vs temperature graph when the user clicks
a plot button. The plot is done in a picturebox using gr.drawline. I would
like for this plot to be made without the user having to click the plot
button, ie when the form opens.

I have tried putting the call to the plotting subroutine in various places:
the pbox.paint event, the form load event, and several other form events.
Nothing seems to work - I am not getting an error, just no graph. If I click
the button, it will still plot.

Any ideas how I might get this to automatically occur when the form opens?

Thanks
--
Mark Lancaster
Nov 21 '05 #1
4 1441
"Mark Lancaster" <Ma***********@ discussions.mic rosoft.com> schrieb:
I have a form that displays a time vs temperature graph when the user
clicks
a plot button. The plot is done in a picturebox using gr.drawline. I
would
like for this plot to be made without the user having to click the plot
button, ie when the form opens.

I have tried putting the call to the plotting subroutine in various
places:
the pbox.paint event, the form load event, and several other form events.
Nothing seems to work - I am not getting an error, just no graph. If I
click
the button, it will still plot.

Any ideas how I might get this to automatically occur when the form opens?

Perform the calculation in the form's 'Load' event handler, store the data
in a data structure and draw the graph in the form's 'Paint' event handler
or overridden 'OnPaint' method.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

I did as you suggested. Now the plot flashes up temperarily in the picbox,
then it gets cleared. Any idea what I could be doing wrong, or have set
wrong?
"Herfried K. Wagner [MVP]" wrote:
"Mark Lancaster" <Ma***********@ discussions.mic rosoft.com> schrieb:
I have a form that displays a time vs temperature graph when the user
clicks
a plot button. The plot is done in a picturebox using gr.drawline. I
would
like for this plot to be made without the user having to click the plot
button, ie when the form opens.

I have tried putting the call to the plotting subroutine in various
places:
the pbox.paint event, the form load event, and several other form events.
Nothing seems to work - I am not getting an error, just no graph. If I
click
the button, it will still plot.

Any ideas how I might get this to automatically occur when the form opens?

Perform the calculation in the form's 'Load' event handler, store the data
in a data structure and draw the graph in the form's 'Paint' event handler
or overridden 'OnPaint' method.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
Perhaps this link will help you:

http://www.bobpowell.net/picturebox.htm

And also this one

http://www.bobpowell.net

Nov 21 '05 #4
Perhaps this link will help you:

http://www.bobpowell.net/picturebox.htm

Also this one:

http://www.bobpowell.net

Nov 21 '05 #5

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

Similar topics

1
6369
by: Greg Scharlemann | last post by:
I would like to automatically populate a drop down menu when the page loads based on the selection of an item in a different drop down menu. I made a test page that when drop down #1 changes, drop down #2 populates. Does anyone know how to get drop down #2 to populate based on what is selected in drop down #1 when the page loads? Here is my test code: ************************************************************************ <html>...
0
747
by: sophocles the wise | last post by:
automatically post data & click buttons on sequence of web pages with AxWebBrowser Hi, I need to post stuff everyday to a website and am working on a VB program to do this for me. I am a computer technician and I post an ad on craigslist.org everyday but sometimes I don't have time to do this. So, I accomplished so far to load the first page and post my ad in the textbox, with title and email address, and to alter the radio button and...
4
12685
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck Gatto Dan Guzman Apr 27 2000, 12:00 am show options
3
6784
by: Scott | last post by:
What is the proper syntax for sending an argument from a form contol to a subroutine in a module? For instance, from a textbox on a form I call a module subroutine from the textbox's OnUpdate event. I want to pass the form's name to the the Module subroutine. What is the proper syntax for the textbox event to pass the form name and what is the correct syntax in the module subroutine to accept the form name as an argument? Thanks Scott
0
1470
by: jason | last post by:
some confusion here. The below code allows me to save a local file to my web server and somehow because the field type is file a local file browse button is rendered. I'm trying to figure out how to incorporate this code into an existing asp.net (vb). In my code "C:\Uploads\uploadedfile.txt" is dynamcially set to a value pulled from a textbox, but how do automatically get browse window to come up when I call a subroutine asp.net....
3
1414
by: Academic | last post by:
If I do the following: System.Windows.Forms.Cursor.Current = Cursors.WaitCursor Do I need to reset the cursor or will that happen automatically when I leave the subroutine?
0
960
by: Mark | last post by:
Hi, I'm new to ASP.Net, but not to c#, so I'm finding some things a little wierd in this internet based world, especially passing data from page to page. I have created a UserControl to search for data. It will first be displayed on the homepage of my website and then on a search results page. When the page loads up, I want to be able to repopulate the options that were first selected on the homepage.
4
2612
by: otterbyte | last post by:
Hi, I have a bit of code which is confusing me to no end. Here are the basics: 1) The class module is being used in the module of a form. 2) There is an instance of the object declared at the form level, and instantiated in the Load event of the form. This instance holds the "current" values (based on data in a table), and it's called ordCurrent.
17
4099
by: handique | last post by:
Hi, I have javascript code for rotating images, but the rotation starts only when mouse is placed over the image. But i want to rotate images automatically when the page loads. Can any guide me in this regard. the javscript for rotating images is : mg src="'+mImages.src+'" onmouseover="this.src=\''+mImagesO.src+'\'" onmouseout="this.src=\''+mImages.src+'\'" border=0 id="img'+this.a3+'" style="cursor:pointer I want to replace...
0
9793
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
9642
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
10777
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
10494
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...
0
10207
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
7748
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...
1
4416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3963
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3076
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.