Questions tagged [onpaint]

An event that is triggered when a GUI component needs to be repainted

onPaint is the method responsible for performing the paint act triggered from a PaintEvent. This event is triggered when a GUI component needs to be repainted, usually as a result of a change to the underlying data behind the GUI component. onPaint is responsible for the physical display of the component, and in particular, applying the themes and colors appropriate for the application/output device.

198 questions
2
votes
0 answers

wxpython: StaticText on transparent background

I am trying to make a subclass of wx.StaticText that has no background. I tried setting the background's alpha component with SetBackgroundColor, or using SetTransparent on various objects with no luck, but maybe it is only because I am a noobie…
Lay
  • 151
  • 1
  • 8
2
votes
5 answers

Efficient use of OnPaint

I am programming in Visual Studio .Net and using C#. I am creating my own control that draws a wave based on values I get from an analog to digital converter (ADC). I take the incoming points and convert them into X and Y points to properly draw…
EatATaco
  • 687
  • 7
  • 25
2
votes
1 answer

onPaint vs form1_paint

I'm drawing all my stuff on a form. So I don't need any controls at all. Currently I have an Form1_Paint method and drawing all inside this event method. private void Form1_Paint(object sender, PaintEventArgs e) { // draw something } I could…
Gaeburider
  • 158
  • 1
  • 12
2
votes
1 answer

How to only Paint viewable content in .net Forms 2.0 CF

I currently have a form with a scrollable panel that potentially contains over 100 child controls (only about 10 are viewable on screen at any time) This causes a lot of flickering when scrolling. I have been looking at some double-buffering…
TheFabledOne
  • 238
  • 1
  • 14
2
votes
4 answers

How to stop Paint events from stacking up

I'm creating an application to schedule different tasks. These are displayed by drawing rectangles on a panel. This has to be responsive. So I need to draw and invalidate on every size change. When I reach a maximum height of my planning panel it…
Toon Casteele
  • 2,479
  • 15
  • 25
2
votes
1 answer

invalidate multiple rectangles or regions

I'm having problems with Invalidate() because it calls OnPaint before I'm ready... Invalidate(new Rectangle(x, y, width, height)) works fine when I need to repaint one and only one area, but what I need to do is create a collection of rectangles to…
thomas
  • 77
  • 1
  • 3
  • 6
2
votes
2 answers

OnPaint does not update

I have a windows form which contains a user control. This user control has the following code: protected override void OnPaint(PaintEventArgs pe) { base.OnPaint(pe); pe.Graphics.DrawRectangle( new Pen(Color.Red, 5 + laenge), new…
Tim Kathete Stadler
  • 1,067
  • 4
  • 26
  • 52
2
votes
1 answer

"Index was outside the bounds of the array" on Infragistics UltraGrid when OnPaint is called

I've binded my grid's DataSource to a BindingSource object which i update from another thread. I've wrote the following code: protected override void OnPaint(PaintEventArgs pe) { if (this.InvokeRequired) { …
Ofershap
  • 687
  • 2
  • 7
  • 22
1
vote
2 answers

PictureBox with overriden OnPaint method in C#

I would like to paint some small pictures in PictureBox (4 x 32px images in a row) so should i override OnPaint method or i need to make my new component that extends PictureBox? I tried this, which worked in Java, but not here: …
Piotr Łużecki
  • 1,031
  • 4
  • 17
  • 33
1
vote
1 answer

MFC dialog disappears after a time-consuming OnPaint()

In our application we have an MFC dialog that opens and processes some data needed to display. Hence the processing is initiated lazily inside OnPaint() event. The processing takes some time (about 20-30 sec), and is solely algorithmic (no UI API…
rag3ous
  • 45
  • 1
  • 6
1
vote
1 answer

OnPaint doesn't draw correctly

Visual Studio 2008 SP1 C# Windows application I am writing and drawing directly to the main form and am having a problem repainting the screen. On program startup, the screen paints correctly. Two more paint messages follow in 3-4 seconds (with no…
1
vote
2 answers

OnPaint() for Java?

All right real quick question guys. I know that C# Forms have the OnPaint() method that keeps on being called when its time to render. I know Java has a similar one but I am lost on how to implement it. Any pointers or example(prefferred) will be…
Mohammad Adib
  • 788
  • 6
  • 19
  • 39
1
vote
1 answer

Override datetimepicker vb.net

I would like to overrides the datetimepicker object to remove the texte when the property _clearOnDisabled is true. When _readOnly property is true, I would like to show the text in black not gray. So I tried with WndProc but I seem that every…
Adam Paquette
  • 1,243
  • 1
  • 14
  • 28
1
vote
2 answers

Timer problem with GDI+

I am currently stuck at a really strange problem with GDI and timers. First the Code: class Graph : UserControl { private System.Threading.Timer timer; private int refreshRate = 25; //Hz (redrawings per second) private float…
Marcel
  • 312
  • 4
  • 8
1
vote
0 answers

OnPaint event doesn't fire in c# custom control Updated

firstly I tried many solutions I found it here but it's still doesn't work! I have a custom textbox control but the OnPaint event doesn't fire: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using…
M.J
  • 143
  • 9