473,767 Members | 2,302 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Update a Draw

Hello,

I've got a small aplication where i design a small scheme using
System.Drawing.

I need to use a NumericUpDown control to change some text i've draw.

I have all the code under:
protected override void OnPaint(PaintEv entArgs paintEvent)

How can i update my draws with new values ?

Thank you

Luis Arnauth

May 8 '06 #1
3 2203
Are you drawing directly on the form or is the drawing being done in a
custom control? If it's the form, then when the value of the NumericUpDown
control changes call the Invalidate method on the form, to request a
repaint, and ensure that you're using the value from the NumericUpDown
control in the OnPaint method.

--
Tim Wilson
..NET Compact Framework MVP

"Luis Arnauth" <lu**@arnauth.n et> wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Hello,

I've got a small aplication where i design a small scheme using
System.Drawing.

I need to use a NumericUpDown control to change some text i've draw.

I have all the code under:
protected override void OnPaint(PaintEv entArgs paintEvent)

How can i update my draws with new values ?

Thank you

Luis Arnauth

May 8 '06 #2
I'm drawing directly on the form using

protected override void OnPaint(PaintEv entArgs paintEvent)

inside there are some circles and text.
I need to know how to refresh the text portion after the user change some
values.

is the method correct for doing this ?

Luis Arnauth

"Tim Wilson" <TIM(UNDERSCORE )WILSON(AT)ROGE RS(PERIOD)COM> wrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
Are you drawing directly on the form or is the drawing being done in a
custom control? If it's the form, then when the value of the NumericUpDown
control changes call the Invalidate method on the form, to request a
repaint, and ensure that you're using the value from the NumericUpDown
control in the OnPaint method.

--
Tim Wilson
.NET Compact Framework MVP

"Luis Arnauth" <lu**@arnauth.n et> wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Hello,

I've got a small aplication where i design a small scheme using
System.Drawing.

I need to use a NumericUpDown control to change some text i've draw.

I have all the code under:
protected override void OnPaint(PaintEv entArgs paintEvent)

How can i update my draws with new values ?

Thank you

Luis Arnauth


May 11 '06 #3
Yes. Just call the Invalidate method on the form when the value has changed
and it will cause the OnPaint method to be called. In the OnPaint method
draw the text.

--
Tim Wilson
..NET Compact Framework MVP

"Luis Arnauth" <lu**@arnauth.n et> wrote in message
news:Od******** ******@TK2MSFTN GP05.phx.gbl...
I'm drawing directly on the form using

protected override void OnPaint(PaintEv entArgs paintEvent)

inside there are some circles and text.
I need to know how to refresh the text portion after the user change some
values.

is the method correct for doing this ?

Luis Arnauth

"Tim Wilson" <TIM(UNDERSCORE )WILSON(AT)ROGE RS(PERIOD)COM> wrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
Are you drawing directly on the form or is the drawing being done in a
custom control? If it's the form, then when the value of the
NumericUpDown control changes call the Invalidate method on the form, to
request a repaint, and ensure that you're using the value from the
NumericUpDown control in the OnPaint method.

--
Tim Wilson
.NET Compact Framework MVP

"Luis Arnauth" <lu**@arnauth.n et> wrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
Hello,

I've got a small aplication where i design a small scheme using
System.Drawing.

I need to use a NumericUpDown control to change some text i've draw.

I have all the code under:
protected override void OnPaint(PaintEv entArgs paintEvent)

How can i update my draws with new values ?

Thank you

Luis Arnauth



May 11 '06 #4

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

Similar topics

5
13224
by: Don Seckler | last post by:
I have an update query that runs when a report closes. I have several reports that will need to run the update query with diferent criteria. I'd like to simply make the criteria change in the report vba instead of making different queries. Here's my query sql: UPDATE Draw SET Draw.Billed = Yes WHERE (((Draw.Billed)=No) AND ((Draw.WholesalerName)="Hudson"));
3
2102
by: pkumar | last post by:
How to implement live update, like stock ticker updates shown in TV .
11
2248
by: Siv | last post by:
Hi, I seem to be having a problem with a DataAdapter against an Access database. My app deletes 3 records runs a da.update(dt) where dt is a data.Datatable. I then proceed to update a list to reflect that the 3 items have been deleted only to discover that the 3 items appear, however when I click on them to display their information which runs a datareader over the same database it appears that the data has now gone. I wondered whether...
3
4165
by: Jon Vaughan | last post by:
I have a form that im using to draw buttons onto, a click on the buttons will cause the text on the buttons to change and some buttons will be hidden , so im looking to stop the redraw on the form until I have finished making these changes, to reduce the flicker. Can someone tell me how to do it ? Thanks
7
6045
by: kebalex | last post by:
Hi, I have an app (written in .NET 2.0) which updates a picturebox according to some user input (a slider control). when the user makes a change i loop through all of the pixels, do a calculation and update the picture. i currently use the GDI SetPixel method on each pixel of the Pictureboxes image. This is proving far to slow, about 1.5 seconds on average. This app needs to display the update as fast as possible. Has anyone got any...
3
5305
by: laryten | last post by:
Hi, Is there a way to update the same web page instead of getting a new page each time we click the submit button? The simplest thing to do is to delete the current page (or go back to the previous page) and then redraw the page. There are a few possible solutions: 1. Use the same URL again. But a new page will still be created. 2. Use the "onsubmit" option:
8
5369
by: =?Utf-8?B?R3JlZyBMYXJzZW4=?= | last post by:
I'm trying to figure out how to modify a panel (panel1) from a backgroundworker thread. But can't get the panel to show the new controls added by the backgroundwork task. Here is my code. In this code there is a panel panel1, that I populate with a lable in the foreground. Then when I click on "button1" a backgroundworker thread in async mode is started. When the backgoundworker thread completes the thread returns a panel to populate...
17
4857
by: cmcdermo | last post by:
Ok my first post here so sorry if i mess something up. I have to edit a page that uses some javascript and not sure really. At the moment a user clicks on a button saying "black and white" and this shows an image on the page in black and white, it also update a hidden form field with the value "BW". This works fine. here is the code for that.
25
2581
by: rekhasc | last post by:
hi...... Its very urgent.............. how can i take only the year and month part and it should save in the database in the month and year field separately......... when i enter the date in the form it should automatically update the year and month field in the db........ in my proj i am drawing a graph on daily, monthly and yearly basis..... i got how to draw a graph on day basis but i dont know how to draw a graph on month and year basis can...
0
10168
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
10009
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
9959
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
9838
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
7381
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
6651
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
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3929
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
3532
muto222
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.