Click here to Skip to main content
16,006,535 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to refresh Win Form [C# 2.0 ] Pin
Josh Smith1-May-06 9:23
Josh Smith1-May-06 9:23 
GeneralRe: How to refresh Win Form [C# 2.0 ] Pin
student_rhr1-May-06 9:46
student_rhr1-May-06 9:46 
GeneralRe: How to refresh Win Form [C# 2.0 ] Pin
student_rhr1-May-06 9:56
student_rhr1-May-06 9:56 
GeneralRe: How to refresh Win Form [C# 2.0 ] Pin
Josh Smith1-May-06 10:26
Josh Smith1-May-06 10:26 
GeneralRe: How to refresh Win Form [C# 2.0 ] Pin
student_rhr1-May-06 11:33
student_rhr1-May-06 11:33 
GeneralRe: How to refresh Win Form [C# 2.0 ] Pin
Judah Gabriel Himango1-May-06 13:08
sponsorJudah Gabriel Himango1-May-06 13:08 
GeneralRe: How to refresh Win Form [C# 2.0 ] Pin
Josh Smith1-May-06 13:11
Josh Smith1-May-06 13:11 
QuestionDrawing the focus rectangle for a button Pin
melanieab1-May-06 6:18
melanieab1-May-06 6:18 
Hi,
I'm trying to draw a focus rectangle on a button, since, when I load a tabpage, if the first control on that page is a button, it doesn't highlight and you can't tell that it has focus.
So I stumbled across the ControlPaint.DrawFocusRectangle command and put this in after loading the rest of the page:
int x = button2.ClientRectangle.Location.X + 3;<br />
int y = button2.ClientRectangle.Location.Y + 3;<br />
int w = button2.ClientRectangle.Width - 6;<br />
int h = button2.ClientRectangle.Height - 6;<br />
Rectangle r = new Rectangle(x,y,w,h);			ControlPaint.DrawFocusRectangle(Graphics.FromHwnd(button2.Handle), r, Color.Red, Color.Red);	


But I get nothing.

Then I added a paint event for the button and moved the code there, although instead of saying Graphics.FromHwnd(button2.Handle), I said e.Graphics. Now it worked, but I'm not able to move away from the button using the up/down arrows. If I throw a messagebox in, after I click the OK button, I can move around without trouble. It seems to have something to do with returning control to the system. Is there anything I can say to give control back to the system? Or am I doing stuff completely wrong?

Thanks so much for any thoughts!!!!!!
Mel

-- modified at 12:18 Monday 1st May, 2006
AnswerRe: Drawing the focus rectangle for a button Pin
Josh Smith1-May-06 7:23
Josh Smith1-May-06 7:23 
QuestionDesign Question Pin
student_rhr1-May-06 6:00
student_rhr1-May-06 6:00 
AnswerRe: Design Question Pin
Dave Kreskowiak1-May-06 6:42
mveDave Kreskowiak1-May-06 6:42 
QuestionSystem Modal Form in .NET Pin
Lav Pathak1-May-06 5:37
Lav Pathak1-May-06 5:37 
AnswerRe: System Modal Form in .NET Pin
Josh Smith1-May-06 6:09
Josh Smith1-May-06 6:09 
GeneralRe: System Modal Form in .NET Pin
Lav Pathak1-May-06 6:22
Lav Pathak1-May-06 6:22 
GeneralRe: System Modal Form in .NET Pin
Josh Smith1-May-06 7:11
Josh Smith1-May-06 7:11 
AnswerRe: System Modal Form in .NET Pin
Ravi Bhavnani1-May-06 7:23
professionalRavi Bhavnani1-May-06 7:23 
GeneralRe: System Modal Form in .NET Pin
Dan Neely1-May-06 7:48
Dan Neely1-May-06 7:48 
AnswerRe: System Modal Form in .NET Pin
S. Senthil Kumar1-May-06 6:56
S. Senthil Kumar1-May-06 6:56 
QuestionConverting the XML form of resultset to string in C# Pin
PrashantJ1-May-06 5:11
PrashantJ1-May-06 5:11 
AnswerRe: Converting the XML form of resultset to string in C# Pin
Guffa1-May-06 5:23
Guffa1-May-06 5:23 
GeneralRe: Converting the XML form of resultset to string in C# Pin
PrashantJ1-May-06 5:27
PrashantJ1-May-06 5:27 
AnswerRe: Converting the XML form of resultset to string in C# Pin
Guffa2-May-06 11:08
Guffa2-May-06 11:08 
QuestionHow to determine what encoding a file has Pin
WCup1-May-06 4:11
WCup1-May-06 4:11 
AnswerRe: How to determine what encoding a file has Pin
Dan Neely1-May-06 4:39
Dan Neely1-May-06 4:39 
GeneralRe: How to determine what encoding a file has Pin
WCup1-May-06 4:48
WCup1-May-06 4:48 

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.