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
0
votes
2 answers

Multiple ordered translate / scale transforms in GDI+

I have a number of graphics objects which I am plotting in a graphics context in a windows forms application. There is some interaction with the ui element in which the paths are rendered which allows the user to pan, zoom and set an origin for the…
Max Palmer
  • 452
  • 3
  • 17
0
votes
1 answer

VB.net changing text in onPaint sub

Hey all i have the following code that works just fine when my form loads up: Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) Dim custFont As New PrivateFontCollection() Dim solidBrush As New SolidBrush(Color.FromArgb(255, 0, 0,…
StealthRT
  • 10,108
  • 40
  • 183
  • 342
0
votes
1 answer

How to draw a manually drawn control inside a manually drawn control?

I have two controls in C# that I override OnPaint() to draw all the visuals myself. I'd like to add one of those controls inside the other. What do I put in my parent control's OnPaint() to call the child control's OnPaint()?
savetruman
  • 145
  • 7
0
votes
2 answers

call onPaint() with button click

I have a picture control box (a CStatic) in a dialog. When the user presses a button in the dialog I need the onPaint() to draw an image in it. The problem is, The image is drawn at the loading of the dialog. How do I prevent this and call it only…
Madz
  • 1,273
  • 2
  • 18
  • 35
0
votes
2 answers

C#, Overriding OnPaint: alpha transparency with double buffer

I'm developing a Windows Mobile 5.0 and above application with .Net Compact Framework 2.0 SP2 with C#. I'm overriding OnPaint method on a custom messagebox that draw a bitmap that fills the entire form with alpha transparency, and a gradient box…
VansFannel
  • 45,055
  • 107
  • 359
  • 626
0
votes
0 answers

Suspend Layout Resume Layout

I am having a user control with a flow layout panel. This control can have one or more same controls. This hierarchy can grow to many levels. Initially I am adding the Root Control. Then Controls are added to the root control (flow layout…
Rajan Panneer Selvam
  • 1,279
  • 10
  • 24
0
votes
1 answer

Class derived from System.Windows.Forms.ProgressBar doesn't get its override OnPaint

I created a class derived from System.Windows.Forms.ProgressBar. I followed the method advised by MSDN: Add a usercontrol to your project Open the code of the user control Instead of deriving it from System.Windows.Forms.UserControl, derive from…
Harald Coppoolse
  • 28,834
  • 7
  • 67
  • 116
0
votes
0 answers

Red Cross on status strip when painting image

I am trying to change the image of a label on a status strip very rapidly and many many times. I am receiving a ArgumentOutOfRangeException. I have put catches in the paint events of both the label and the status strip as well as the OnPaint…
0
votes
1 answer

update just a portion of a usercontrol

I'm developing a timeline user control for video usage. here is a photo of my work: here i have problem. when currentTime changes, I have to update the UI. but when i use this.Invalidate(); it refreshes the whole control. but i want to just update…
mahdi gh
  • 438
  • 1
  • 7
  • 18
0
votes
2 answers

Windows Forms UserControl overrides not being called

I am creating a Windows Forms control derived from UserControl to be embedded in a WPF app. I have generally followed the procedures given in this link. public ref class CTiledImgViewControl : public UserControl { ... virtual void OnPaint(…
Brian Stewart
  • 9,157
  • 11
  • 54
  • 66
0
votes
1 answer

Drawing tileset graphics to screen on paint event running slow

as you may be able to tell from the code below I'm quite new to C#. For my first project (as a kind of test) I have made a 2D level editor, it has 5 layers. In the code below I am for-eaching through a shortlist dictionary which is generated…
Zephni
  • 753
  • 1
  • 7
  • 26
0
votes
0 answers

Flickering when showing a translucend custom Form via ShowDialog()

I need to show a dialog form (MessageForm) over the main Form (ParentForm). The MessageForm contains a panel (mainPanel) on which I add some controls on runtime (the close button and many Labels and LinkLabels). MessageForm has a specific behavior:…
kirpi4
  • 143
  • 1
  • 1
  • 11
0
votes
3 answers

A control disappears from parent UserControl after UserControl's OnRepaint event

I have a UserControl which has a button on it. On the UserControl OnPaint event I draw a rounded corner border (or a simple rectangle if the radius is zero) and then I fill the entire control. After these manipulations my Button (btnClose)…
kirpi4
  • 143
  • 1
  • 1
  • 11
0
votes
2 answers

OnPaint redraws everything, can something stay?

Let's say for example my OnPaint draws a line which is as long as a variable called length. Also there is a bool called color. If the bool is true, the line will be red, if it is false, the line will be black. Would be possible to have two different…
Tim Kathete Stadler
  • 1,067
  • 4
  • 26
  • 52
0
votes
2 answers

Form Paint event in VB.net

Weird issue: I have application that I fire some code in the Form_Paint event for the main form, it works fine on my machine, but on other machines is not working at all. I tried to debug the code on the other machine, and Form_Paint event is not…
Mark