Click here to Skip to main content
15,896,500 members
Home / Discussions / C#
   

C#

 
AnswerRe: How can a parent control draw on child controls? Pin
KingTermite20-Jun-03 6:56
KingTermite20-Jun-03 6:56 
GeneralRe: How can a parent control draw on child controls? Pin
Arun Bhalla20-Jun-03 12:46
Arun Bhalla20-Jun-03 12:46 
GeneralRe: How can a parent control draw on child controls? Pin
lxwde7-Dec-05 15:34
lxwde7-Dec-05 15:34 
GeneralCreate Pen Pin
dichen19-Jun-03 18:44
dichen19-Jun-03 18:44 
GeneralRe: Create Pen Pin
Nick Parker19-Jun-03 19:02
protectorNick Parker19-Jun-03 19:02 
GeneralRe: Create Pen Pin
Arun Bhalla19-Jun-03 21:28
Arun Bhalla19-Jun-03 21:28 
GeneralRe: Create Pen Pin
J. Dunlap19-Jun-03 21:35
J. Dunlap19-Jun-03 21:35 
GeneralMy painting code runs like a dog Pin
paulb19-Jun-03 14:44
paulb19-Jun-03 14:44 
I have a override of the Panel control where I draw a dotted-line grid in it. But the painting is really slow whenever the control needs to redraw.

This is the paint code:


protected override void OnPaint(PaintEventArgs pe)
{
	base.OnPaint(pe);
	if (ShowGrid && !this.DesignMode)
	{
		this.SuspendLayout();
		Graphics g = pe.Graphics;
		Pen pen = new Pen(Color.Black, 1);
		pen.DashStyle = DashStyle.Dot;
		Point p1 = new Point(0,0);
		Point p2 = new Point(0,0);
		for (int x = BorderSize.Width; x < this.Size.Width - BorderSize.Width; x += GridSize.Width)
		{
			p1.X = x; p1.Y = BorderSize.Height;
			p2.X = x; p2.Y = this.Size.Height - BorderSize.Height;
			g.DrawLine(pen, p1, p2);
		}
		for (int y = BorderSize.Height; y < this.Size.Height - BorderSize.Height; y += GridSize.Height)
		{
			p1.X = BorderSize.Width; p1.Y = y;
			p2.X = this.Size.Width - BorderSize.Width; p2.Y = y;
			g.DrawLine(pen, p1, p2);
		}
		this.ResumeLayout();
	}
}

GeneralRe: My painting code runs like a dog Pin
James T. Johnson19-Jun-03 16:44
James T. Johnson19-Jun-03 16:44 
GeneralRe: My painting code runs like a dog Pin
paulb19-Jun-03 17:10
paulb19-Jun-03 17:10 
GeneralCustom Forms Pin
Anonymous19-Jun-03 9:23
Anonymous19-Jun-03 9:23 
GeneralRe: Custom Forms Pin
Kannan Kalyanaraman19-Jun-03 22:20
Kannan Kalyanaraman19-Jun-03 22:20 
Questionwhere did my toolbox form controlls go??? Pin
ken-l119-Jun-03 6:10
ken-l119-Jun-03 6:10 
AnswerRe: where did my toolbox form controlls go??? Pin
leppie19-Jun-03 7:06
leppie19-Jun-03 7:06 
AnswerRe: where did my toolbox form controlls go??? Pin
dazinith19-Jun-03 7:30
dazinith19-Jun-03 7:30 
GeneralManipulating Dataset coluns bound to datagrid Pin
Steve McLenithan19-Jun-03 5:53
Steve McLenithan19-Jun-03 5:53 
GeneralRe: Manipulating Dataset coluns bound to datagrid Pin
Dimitris Iliopoulos19-Jun-03 8:13
Dimitris Iliopoulos19-Jun-03 8:13 
GeneralRe: Manipulating Dataset coluns bound to datagrid Pin
Steve McLenithan19-Jun-03 8:23
Steve McLenithan19-Jun-03 8:23 
GeneralRe: Manipulating Dataset coluns bound to datagrid Pin
Steve McLenithan19-Jun-03 8:36
Steve McLenithan19-Jun-03 8:36 
QuestionHow Timer works Pin
puppiesLover19-Jun-03 5:41
puppiesLover19-Jun-03 5:41 
AnswerRe: How Timer works Pin
Manster19-Jun-03 6:11
Manster19-Jun-03 6:11 
QuestionHow ow to alternate color on items of combo/list box, gurus? Pin
Khang Nguyen19-Jun-03 5:10
Khang Nguyen19-Jun-03 5:10 
AnswerRe: How ow to alternate color on items of combo/list box, gurus? Pin
Manster19-Jun-03 6:28
Manster19-Jun-03 6:28 
GeneralRe: How ow to alternate color on items of combo/list box, gurus? Pin
Khang Nguyen19-Jun-03 11:11
Khang Nguyen19-Jun-03 11:11 
GeneralFast image processing Pin
aeros19-Jun-03 4:50
aeros19-Jun-03 4:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.