Click here to Skip to main content
15,911,646 members
Home / Discussions / C#
   

C#

 
QuestionNetwork communications Pin
Wjousts24-Oct-05 10:58
Wjousts24-Oct-05 10:58 
AnswerRe: Network communications Pin
enjoycrack24-Oct-05 12:29
enjoycrack24-Oct-05 12:29 
GeneralRe: Network communications Pin
Wjousts25-Oct-05 2:06
Wjousts25-Oct-05 2:06 
QuestionDelete Event Pin
Agyeman24-Oct-05 10:20
Agyeman24-Oct-05 10:20 
AnswerRe: Delete Event Pin
Judah Gabriel Himango24-Oct-05 12:19
sponsorJudah Gabriel Himango24-Oct-05 12:19 
GeneralRe: Delete Event Pin
Anonymous24-Oct-05 13:35
Anonymous24-Oct-05 13:35 
QuestionFill form with Rectangle Pin
har04mich24-Oct-05 9:24
har04mich24-Oct-05 9:24 
AnswerRe: Fill form with Rectangle Pin
Wjousts24-Oct-05 10:03
Wjousts24-Oct-05 10:03 
As I told you last time, override the OnPaint method and draw your grid using the Graphics.DrawLine method. Something like this:

<br />
		protected override void OnPaint(PaintEventArgs e)<br />
		{<br />
			Pen p = new Pen(Color.Black);<br />
			int width = this.ClientRectangle.Width/20;<br />
			int height = this.ClientRectangle.Height/20;<br />
			int x = 0;<br />
			int y = 0;<br />
			for (int i = 0; i<20; i++)<br />
			{<br />
				e.Graphics.DrawLine(p,x,0,x,this.ClientRectangle.Bottom);<br />
				e.Graphics.DrawLine(p,0,y,this.ClientRectangle.Right,y);<br />
				x += width;<br />
				y += height;<br />
			}<br />
			base.OnPaint (e);<br />
		}<br />


Would work. It would need some cleaning up and you might want to make sure your form size will fit exactly 20 squares because otherwise the last row and column may be bigger than the others. Or you could draw a border around the grid . Whatever works for you.
GeneralRe: Fill form with Rectangle Pin
har04mich24-Oct-05 10:10
har04mich24-Oct-05 10:10 
QuestionA net message Pin
Anonymous24-Oct-05 9:19
Anonymous24-Oct-05 9:19 
GeneralMillora en el login Pin
Anonymous24-Oct-05 9:02
Anonymous24-Oct-05 9:02 
GeneralRe: Millora en el login Pin
André Ziegler24-Oct-05 12:05
André Ziegler24-Oct-05 12:05 
QuestionLogin Pin
Rugi24-Oct-05 8:59
Rugi24-Oct-05 8:59 
AnswerRe: Login Pin
André Ziegler24-Oct-05 12:08
André Ziegler24-Oct-05 12:08 
Questionhow to create window Pin
pakFari24-Oct-05 8:39
pakFari24-Oct-05 8:39 
AnswerRe: how to create window Pin
Daniel Grunwald24-Oct-05 8:47
Daniel Grunwald24-Oct-05 8:47 
QuestionRe: how to create window Pin
Anonymous24-Oct-05 9:12
Anonymous24-Oct-05 9:12 
AnswerRe: how to create window Pin
pakFari24-Oct-05 19:05
pakFari24-Oct-05 19:05 
GeneralRe: how to create window Pin
pakFari25-Oct-05 8:22
pakFari25-Oct-05 8:22 
QuestionRegex token type question Pin
jeweladdict24-Oct-05 8:39
jeweladdict24-Oct-05 8:39 
AnswerRe: Regex token type question Pin
Christian Graus24-Oct-05 13:41
protectorChristian Graus24-Oct-05 13:41 
QuestionClosing Application Properly Pin
Dwayner7924-Oct-05 8:35
Dwayner7924-Oct-05 8:35 
AnswerRe: Closing Application Properly Pin
S. Senthil Kumar24-Oct-05 19:41
S. Senthil Kumar24-Oct-05 19:41 
Questionrich text box Pin
Agyeman24-Oct-05 7:44
Agyeman24-Oct-05 7:44 
AnswerRe: rich text box Pin
mav.northwind24-Oct-05 9:05
mav.northwind24-Oct-05 9:05 

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.