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
1 answer

c# how to call onpaint continuously without lag

I am making a custom user control , but when i override OnPaint() , it is not call continuously . This is my code : [ToolboxData("<{0}:ColoredProgressBar runat=server>")] public class ColoredProgressBar :…
Ben
  • 39
  • 1
  • 10
0
votes
0 answers

Is there a way to fix the text issue on a custom menu strip options in WinForm C++ when moving to one monitor to another?

I did a lot of search and research and didn't find a answer for my probleam, so.. I made a custom Menu using WinForm C++, where we override the Renderer and OnPaint methods. Our application can move to one monitor to another and when we do that, the…
0
votes
0 answers

Can't get overridden OnPaint function to work for custom Panel - C#

I'm trying to create a border for my Panels that can change in thickness and color. After doing some research, I discovered that the only good way to do this is to create my own custom Panel and to override the OnPaint function. This is what I've…
Nick08
  • 157
  • 1
  • 2
  • 10
0
votes
0 answers

CDialog child windows

I just wanted to use insde of a good old MFC Dialog based application 2 more moveable dialogs as childs. After solution wizard, i made a Default Dialog resource (child style) and created 2 dialogs in OnInitDialog of the main Dialog: m_P1 = new…
0
votes
1 answer

e.Graphics usage

I found that there is difference between Graphics g and e.Graphics from paint event .. e.Graphics is something like "more PRO" which allows more fun with transformations matrices. Transformations like this…
user1097772
  • 3,499
  • 15
  • 59
  • 95
0
votes
0 answers

How can I make a custom drawing to resize in a pictubrebox

I have a C# Winform where Im drawing some rectangles. I have set all the variables (width, height, x, y) of all rectangles so it can fit in the actual size of the picture box. What I want is to resize my form and also resize all my drawings. Would…
VAAA
  • 14,531
  • 28
  • 130
  • 253
0
votes
0 answers

C# how to rotate an image painted in picturebox

I have the following image (C# WinForms) that is painted inside a picturebox: And this is the code inside the Paint event: private void pbBox_Paint(object sender, PaintEventArgs e) { Rectangle leftInsertionBox = new…
VAAA
  • 14,531
  • 28
  • 130
  • 253
0
votes
1 answer

How do I draw a transparent rectangle?

I am nearly there with this ... :) I have implemented my own double buffer ... So I create a bitmap: if (_Bitmap != null) _Bitmap.Dispose(); if (_Graphics != null) _Graphics.Dispose(); _Bitmap = new Bitmap(Bounds.Width,…
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
0
votes
1 answer

Why am I getting a 'parameter not valid' exception?

Basically I have no idea why im getting a Parameter not Valid exception because from what I have learned through google, it is a common exception that gives you no insight on whats actually going on behind the scenes, or whats essentially causing…
BlazeXenon
  • 40
  • 1
  • 8
0
votes
0 answers

Mousedown event firing Paint event too many times from OnPaint

So, in my program, I have a mousedown event that is looking for the X,Y coord of where the user clicked. Within the mousedown event is a series of 'if' conditions that determine how to call a subroutine that draws a vertical line at the X-coord of…
0
votes
0 answers

VB.Net - How to change shape and add details in custom button

I'm trying to create a custom button for an application in VB.net: more specifically, this is what I'd like my control to look like. Custom Button I've managed to find a tutorial explaining how to reshape a control using GraphicsPath, and thanks to…
0
votes
1 answer

C# DrawImage using DoubleBuffered not working

Hi I have a c# usercontrol that I override OnPaint method. In my OnPaint Method I have the following code: // Draw the new button. protected override void OnPaint(PaintEventArgs e) { Color btnColor = this.ButtonColor; if…
VAAA
  • 14,531
  • 28
  • 130
  • 253
0
votes
1 answer

TabControl OnPaint calling

I have a custom TabControl control. Here's the OnPaint method: Protected Overrides Sub OnPaint(e As PaintEventArgs) G = e.Graphics G.SmoothingMode = Drawing2D.SmoothingMode.HighQuality G.TextRenderingHint =…
Gilbert Williams
  • 970
  • 2
  • 10
  • 24
0
votes
2 answers

Can't get Control.OnPaint method to work

I couldnt find anything like that at all (basicly every problem from so else is always a syntax problem) and well..., the situation is a bit more complicated. to avoid using 500 lines of code im going to describe it for the most part: Ive got a Form…
0
votes
0 answers

What is the optimal way to display images fast (C#)

I am trying to create an application to display 8/16bit grayscale video. Currently, I create a BMP bitmap as RGB48 from frames, and simply assign pictureBox.Image = bmp This requires to create three redundant channels to make an RGB image look like…
Nazar
  • 820
  • 5
  • 13
  • 36