PC Review


Reply
Thread Tools Rate Thread

Automatically executing a subroutine when a form loads

 
 
=?Utf-8?B?TWFyayBMYW5jYXN0ZXI=?=
Guest
Posts: n/a
 
      24th Mar 2005

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
 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      24th Mar 2005
"Mark Lancaster" <(E-Mail Removed)> 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/>

 
Reply With Quote
 
=?Utf-8?B?TWFyayBMYW5jYXN0ZXI=?=
Guest
Posts: n/a
 
      24th Mar 2005

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" <(E-Mail Removed)> 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/>
>
>

 
Reply With Quote
 
Chris Dunaway
Guest
Posts: n/a
 
      24th Mar 2005
Perhaps this link will help you:

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

And also this one

http://www.bobpowell.net

 
Reply With Quote
 
Chris Dunaway
Guest
Posts: n/a
 
      24th Mar 2005
Perhaps this link will help you:

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

Also this one:

http://www.bobpowell.net

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to automatically change tab showint when form loads Tom Woodard Microsoft Access Macros 1 21st Feb 2009 03:38 AM
executing a subform's subroutine from the main form David Gartrell Microsoft Access Forms 2 16th Nov 2006 09:10 AM
Executing a subroutine from within a loop Jeff@DE Microsoft Excel Programming 1 9th Jan 2006 10:04 AM
subroutine not executing on filter fail - why? Kurt Wimberger via AccessMonster.com Microsoft Access Form Coding 5 27th Apr 2005 07:08 PM
stop javascript from executing when the page loads? MMJII Microsoft Frontpage 3 14th Oct 2003 04:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:12 AM.