473,473 Members | 2,303 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Maybe be a Graphics Question or just a Dumb one.

I have a program whose main form has a picture box on which concrete column
sections are drawn. Input to the drawing is achieved by filling in data in
various dialog boxes (called by using Form.Showdialog). When a dialog box
is closed the drawing on the picture box is updated.

Everything works fine when I run the program from the VS2005 IDE. However,
when I run the program by clicking on the .exe outside the IDE, I have to
keep minimizing the main form for the drawing to update.

Any ideas on what possibly could be going wrong, will be greatly
appreciated.

Sep 11 '07 #1
8 1287
Keith Rebello wrote:
I have a program whose main form has a picture box on which concrete column
sections are drawn. Input to the drawing is achieved by filling in data in
various dialog boxes (called by using Form.Showdialog). When a dialog box
is closed the drawing on the picture box is updated.

Everything works fine when I run the program from the VS2005 IDE. However,
when I run the program by clicking on the .exe outside the IDE, I have to
keep minimizing the main form for the drawing to update.

Any ideas on what possibly could be going wrong, will be greatly
appreciated.
What do you do in the code to update the image? Do you call the
Invalidate method of the control?

--
Göran Andersson
_____
http://www.guffa.com
Sep 11 '07 #2
"Keith Rebello" <kr******@corefundamentals.comschrieb:
>I have a program whose main form has a picture box on which concrete column
sections are drawn. Input to the drawing is achieved by filling in data in
various dialog boxes (called by using Form.Showdialog). When a dialog box
is closed the drawing on the picture box is updated.

Everything works fine when I run the program from the VS2005 IDE.
However, when I run the program by clicking on the .exe outside the IDE, I
have to keep minimizing the main form for the drawing to update.
Where did you place the drawing code? In the picturebox' 'Paint' event
handler or somewhere else?

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

Sep 11 '07 #3
I placed the code in a subroutine that is calls Paint event of the
picturebox.

Keith

"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:uE*************@TK2MSFTNGP05.phx.gbl...
"Keith Rebello" <kr******@corefundamentals.comschrieb:
>>I have a program whose main form has a picture box on which concrete
column sections are drawn. Input to the drawing is achieved by filling in
data in various dialog boxes (called by using Form.Showdialog). When a
dialog box is closed the drawing on the picture box is updated.

Everything works fine when I run the program from the VS2005 IDE.
However, when I run the program by clicking on the .exe outside the IDE,
I have to keep minimizing the main form for the drawing to update.

Where did you place the drawing code? In the picturebox' 'Paint' event
handler or somewhere else?

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

Sep 11 '07 #4
To be precise, I have a class in my program called ColumnSection. It has a
Draw Method. I add a handler in the class to the Paint event of the
PictureBox. The class has a Canvas Property to which this PictureBox is
assigned. So, what I have in the class is:

AddHandler Canvas.Paint, AddressOf Draw

I hope this clarifies things.

"Keith Rebello" <kr******@corefundamentals.comwrote in message
news:Eb*******************@newsfe20.lga...
>I placed the code in a subroutine that is calls Paint event of the
picturebox.

Keith

"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:uE*************@TK2MSFTNGP05.phx.gbl...
>"Keith Rebello" <kr******@corefundamentals.comschrieb:
>>>I have a program whose main form has a picture box on which concrete
column sections are drawn. Input to the drawing is achieved by filling
in data in various dialog boxes (called by using Form.Showdialog). When
a dialog box is closed the drawing on the picture box is updated.

Everything works fine when I run the program from the VS2005 IDE.
However, when I run the program by clicking on the .exe outside the IDE,
I have to keep minimizing the main form for the drawing to update.

Where did you place the drawing code? In the picturebox' 'Paint' event
handler or somewhere else?

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


Sep 11 '07 #5
Keith Rebello wrote:
To be precise, I have a class in my program called ColumnSection. It has a
Draw Method. I add a handler in the class to the Paint event of the
PictureBox. The class has a Canvas Property to which this PictureBox is
assigned. So, what I have in the class is:

AddHandler Canvas.Paint, AddressOf Draw

I hope this clarifies things.
So you are just using the picture box as a panel, not for displaying a
picture?

What code do you have to make the control update itself? Do you call the
Invalidate method for the control?

--
Göran Andersson
_____
http://www.guffa.com
Sep 11 '07 #6
I do not call the Invalidate method of the control. The drawing is done in
the Paint event of the control. The main question here is - Why does it
work perfectly when run from the IDE and work incorrectly when it is run
from the .exe?

Thanks.

"Göran Andersson" <gu***@guffa.comwrote in message
news:eN**************@TK2MSFTNGP02.phx.gbl...
Keith Rebello wrote:
>To be precise, I have a class in my program called ColumnSection. It has
a Draw Method. I add a handler in the class to the Paint event of the
PictureBox. The class has a Canvas Property to which this PictureBox is
assigned. So, what I have in the class is:

AddHandler Canvas.Paint, AddressOf Draw

I hope this clarifies things.

So you are just using the picture box as a panel, not for displaying a
picture?

What code do you have to make the control update itself? Do you call the
Invalidate method for the control?

--
Göran Andersson
_____
http://www.guffa.com

Sep 12 '07 #7
Keith Rebello wrote:
I do not call the Invalidate method of the control. The drawing is done in
the Paint event of the control. The main question here is - Why does it
work perfectly when run from the IDE and work incorrectly when it is run
from the .exe?

Thanks.
It doesn't work incorrectly when you run the executable, if you are not
doing anything to make the control redraw itself, you shouldn't see any
updates.

I don't know why it's not working the same when you run it from the IDE.
Are you compiling in debug or release mode?

--
Göran Andersson
_____
http://www.guffa.com
Sep 12 '07 #8
Goran, I really appreciate you trying to help me. I was under the
impression that the Paint event of the PictureBox control was fired
everytime something over it changed. I will try explicitly invalidating the
control.

I think I have decent coding skills, but I sure am not a programmer. I have
no idea whether I am compiling in debug or release mode. I don't even know
where I need to look to answer that question.

"Göran Andersson" <gu***@guffa.comwrote in message
news:ea**************@TK2MSFTNGP02.phx.gbl...
Keith Rebello wrote:
>I do not call the Invalidate method of the control. The drawing is done
in the Paint event of the control. The main question here is - Why does
it work perfectly when run from the IDE and work incorrectly when it is
run from the .exe?

Thanks.

It doesn't work incorrectly when you run the executable, if you are not
doing anything to make the control redraw itself, you shouldn't see any
updates.

I don't know why it's not working the same when you run it from the IDE.
Are you compiling in debug or release mode?

--
Göran Andersson
_____
http://www.guffa.com

Sep 12 '07 #9

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

Similar topics

12
by: Sanjay | last post by:
hi, We are currently porting our project from VB6 to VB .NET. Earlier we used to make scale transformations on objects like pictureBox , forms etc.Now Such transformations are made on the...
2
by: eBob.com | last post by:
This real novice VB.NET programmer wants to put a "scatterplot" (just a bunch of dots) on his form. There'll be other stuff on the form too, but it's the scatterplot which I need your help on. Is...
7
by: Peter Row | last post by:
Hi, I've started work on my own control some parts of which use standard controls, others I need to draw on my controls surface to get the display output I require, however.... I seem to be...
6
by: Chris Dunaway | last post by:
The method for printing documents in .Net can be confusing, especially for newer users. I would like to create a way to simplify this process. My idea would be implemented using a PrintDocument...
6
by: active | last post by:
I have an image and a graphics object created (FromImage) from that image. I need to create a new image and create a new graphics object from the new image. I want the new graphics object have...
37
by: HangEveryRepubliKKKan | last post by:
"Jeremy Fisher" <freya@linux.serverwrote So much for LinTard Land. Here in the real world.... Microsoft profits up 23% this year over last. Ahahahahahahaha.... Vista is now eating away at...
3
by: t | last post by:
I have been learning C++ on my own. For some projects, I would like to use graphics. What is the easiest way to do this? (I am using Visual Studio Express 2005.) Separate from the ease of use...
9
by: koschwitz | last post by:
Hi, I hope you guys can help me make this simple application work. I'm trying to create a form displaying 3 circles, which independently change colors 3 times after a random time period has...
4
by: AWW | last post by:
XP VB 2005 drawing line graphics in a PictureBox - from a simple minded former FORTRAN programmer. The help examples have the graphics drawing code (lines & rectangles) in the PictureBox paint...
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
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,...
0
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...
1
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,...
1
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...
0
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...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.