Click here to Skip to main content
15,867,568 members
Home / Discussions / C#
   

C#

 
GeneralRe: Weird problem Pin
hxxbin29-Jan-04 11:59
hxxbin29-Jan-04 11:59 
GeneralDrawing a rectangle Pin
thomasa29-Jan-04 3:24
thomasa29-Jan-04 3:24 
GeneralRe: Drawing a rectangle Pin
Heath Stewart29-Jan-04 4:06
protectorHeath Stewart29-Jan-04 4:06 
GeneralRe: Drawing a rectangle Pin
thomasa29-Jan-04 23:38
thomasa29-Jan-04 23:38 
GeneralRe: Drawing a rectangle Pin
Heath Stewart30-Jan-04 3:16
protectorHeath Stewart30-Jan-04 3:16 
GeneralRe: Drawing a rectangle Pin
thomasa2-Feb-04 0:39
thomasa2-Feb-04 0:39 
GeneralRe: Drawing a rectangle Pin
thomasa2-Feb-04 2:04
thomasa2-Feb-04 2:04 
GeneralRe: Drawing a rectangle Pin
Heath Stewart2-Feb-04 2:47
protectorHeath Stewart2-Feb-04 2:47 
You're original response stated that you wanted the rectangle drawn around the button. If you would've stated your intentions correctly, I could have given you a good idea of what to do the first time. You also could've used a number of methods from the ControlPaint class in System.Windows.Forms, but for your needs as stated originally I knew this wouldn't work for you.

In any case, you must understand how painting works and how client coordinates are calculated. When you put the painting code in your main form (assuming your Panel wasn't docked), the coordinates where in the client-space of the form, not the panel. Client coordinates are calculated in terms of the container. A Form is a container, just as a Panel is a container. Also, if a Controls handles it's own painting, the painting effects of the container class are not easily made visible (there's a number of things that must be set correctly) because they have two different HDCs that are managed for each control.

 

Microsoft MVP, Visual C#
My Articles
GeneralSorting in cyclic order Pin
Shree29-Jan-04 2:26
Shree29-Jan-04 2:26 
GeneralRe: Sorting in cyclic order Pin
Heath Stewart29-Jan-04 3:57
protectorHeath Stewart29-Jan-04 3:57 
GeneralRe: Sorting in cyclic order Pin
Shree29-Jan-04 6:07
Shree29-Jan-04 6:07 
GeneralVoice in C# AGAIN Pin
Abkarino29-Jan-04 1:00
Abkarino29-Jan-04 1:00 
GeneralRe: Voice in C# AGAIN Pin
Heath Stewart29-Jan-04 2:35
protectorHeath Stewart29-Jan-04 2:35 
GeneralCall Webservice from windows client problem Pin
Mazdak28-Jan-04 23:56
Mazdak28-Jan-04 23:56 
GeneralRe: Call Webservice from windows client problem Pin
Heath Stewart29-Jan-04 3:20
protectorHeath Stewart29-Jan-04 3:20 
GeneralRe: Call Webservice from windows client problem Pin
Mazdak29-Jan-04 4:54
Mazdak29-Jan-04 4:54 
GeneralRe: Call Webservice from windows client problem Pin
Heath Stewart29-Jan-04 6:52
protectorHeath Stewart29-Jan-04 6:52 
GeneralRe: Call Webservice from windows client problem Pin
Mazdak29-Jan-04 7:04
Mazdak29-Jan-04 7:04 
GeneralRe: Call Webservice from windows client problem Pin
Heath Stewart29-Jan-04 7:32
protectorHeath Stewart29-Jan-04 7:32 
Generalmultiple search engine querying tool! Pin
mali28-Jan-04 23:15
mali28-Jan-04 23:15 
GeneralRe: multiple search engine querying tool! Pin
Heath Stewart29-Jan-04 3:12
protectorHeath Stewart29-Jan-04 3:12 
GeneralCancel Button on collection Editor Pin
arti_ab28-Jan-04 22:50
arti_ab28-Jan-04 22:50 
GeneralRe: Cancel Button on collection Editor Pin
Heath Stewart29-Jan-04 3:07
protectorHeath Stewart29-Jan-04 3:07 
GeneralAssertion in C# app Pin
ip_tgz28-Jan-04 20:23
ip_tgz28-Jan-04 20:23 
GeneralRe: Assertion in C# app Pin
Mazdak28-Jan-04 20:55
Mazdak28-Jan-04 20:55 

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.