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
1
vote
0 answers

Draw border around GLControl - openTK winform

I'm using a glcontrol for showing continues frames from a video. Now I want to draw a border around this glcontrol. I have done like below. But when resizing or changing the location of the glcontrol this border is not coming. How can I solve…
nsds
  • 961
  • 4
  • 13
  • 39
1
vote
1 answer

wxpython: adding panel to wx.Frame disables/conflicts with wx.Frame's OnPaint?

I just encountered this strange situation: I found an example, where wx.Frame's OnPaint is overridden, and a circle is drawn. Funnily, as soon as I add even a single panel to the frame, the circle is not drawn anymore - in fact, OnPaint is not…
sdaau
  • 36,975
  • 46
  • 198
  • 278
1
vote
1 answer

Rectangle not showing on OnPaint MFC

I have a dialog based application written in c++ and MFC. The dialog has a CStatic picture control. I am drawing a BITMAP in the OnPaint() function of the PictureCtrl. The relevant code is as follows: void PictureCtrl::OnPaint() { CDC* pDC =…
ubaabd
  • 435
  • 2
  • 13
1
vote
1 answer

OnPaint Invokes itself when mousing over buttons

EDIT: I've tried to solve this for over a week and I have searched here and elsewhere as well. I'd like to begin with explaining that I am a hobby programmer and have nobody to ask for help. I can only read the books I buy and guides on the internet…
P. Najnty
  • 19
  • 2
1
vote
1 answer

Winforms OnPaint not being called after Exception in Chart

Hello devs of the internet! The Winforms.DataVisualization.Charting.Chart draws itself as a big red cross if the axes or displayed points take values they should not have. This happens when an exception occurs inside the OnPaint method. Other…
Otterprinz
  • 459
  • 3
  • 10
1
vote
0 answers

Device context null in OnEraseBkgnd(CDC* pDC) handler

I am facing a problem where I am getting the device context as NULL in OnEraseBkgnd fucntion handler. I have OnEraseBkgnd handler in my custom Tab control class which is inherited from CTabCtrl, I am also getting the same problem in…
Sannuthi M
  • 11
  • 2
1
vote
0 answers

FIXED : Delphi drawing on PlotGrid glitch? requires form resize first

UPDATE................... OK I am stupid. I was making a mistake on how I was pushing the cos wave across the screen which did not show the updates until the form changed sizes...BUT I did find something very interesting regarding the timage and…
rebible
  • 99
  • 6
1
vote
2 answers

C#: Override DataGridView Scrollbars (custom OnPaint)?

I have a usercontrol that inherits from a DataGridView. I have overridden OnRowPrePaint, OnRowPostPaint, OnCellPaint, and some others so I can draw the entire thing as I want. Everything works beautifully, except the scrollbars. How can I intercept…
Nick
  • 739
  • 11
  • 22
1
vote
2 answers

Extend System.Windows.Forms.ComboBox

I would like to extend the System.Windows.Forms.ComboBox control with a ReadOnly property, which would display the selected item’s text (similar to a label) when ReadOnly = true. (I do not like the disabled look achieved by setting…
Preets
  • 6,792
  • 12
  • 37
  • 38
1
vote
4 answers

.Net DrawString font reference changes after invoking

Given the following code. Is there any potential for the first DrawString method to draw in Arial rather than Times New Roman? protected override void OnPaint(PaintEventArgs pe) { Font f = new Font("Times New Roman", this.TextSize); …
Matt Fellows
  • 6,512
  • 4
  • 35
  • 57
1
vote
1 answer

Do I need to restore the Graphics state after painting in my OnPaint override (for a .NET Control)

Consider the following overriden OnPaint method for a .NET Control: protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); e.Graphics.RotateTransform(180); // lots of drawing code } Is it a problem that I do not restore the…
GarethOwen
  • 6,075
  • 5
  • 39
  • 56
1
vote
0 answers

Visual Basic 6: How to add Paint handler?

I've inherited a Visual Basic 6 project. I need to add a Paint handler to a form for some custom graphics, but can't see any way to do this. I've looked at every option in the Visual Basic development environment and Googled, but there's no clue. …
UserX
  • 485
  • 5
  • 12
1
vote
2 answers

Why doesn't work custom control's paint event in Form.cs?

I have a custom button. OnPaint method is working in control's class file but the Button.Paint method doesn't work in Form.cs. Why does this happen and how can it be fixed? My code for button: //code... public AltoButton() { …
Ali Tor
  • 2,772
  • 2
  • 27
  • 58
1
vote
1 answer

How to invalidate the child panel alone in windows forms?

I have created the two custom panels (ParentPanel and ChildPanel) and added the ChildPanel as children of the ParentPanel. Now i want to invalidate the child panel alone. But while calling ChildPanel.Invalidate(), OnPaint method have been called for…
Selvamz
  • 362
  • 3
  • 16
1
vote
2 answers

GDI+ Paint Queue Problem

comrades) I've found some interesting behavior of Invalidate method in multithreaded applications. I hope you could help me with a problem... I experience troubles while trying to invalidate different controls at one time: while they're identical,…
Mikant
  • 299
  • 3
  • 18