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

C#

 
GeneralRe: Is there an #define for the compiler version? Pin
Heath Stewart26-May-04 4:23
protectorHeath Stewart26-May-04 4:23 
GeneralTooltips Pin
Joel Holdsworth25-May-04 10:11
Joel Holdsworth25-May-04 10:11 
GeneralRe: Tooltips Pin
Heath Stewart25-May-04 10:37
protectorHeath Stewart25-May-04 10:37 
GeneralRe: Tooltips Pin
Heath Stewart25-May-04 11:25
protectorHeath Stewart25-May-04 11:25 
Generaladding dataset to webform generating error Pin
DeSonny25-May-04 10:00
DeSonny25-May-04 10:00 
GeneralWrite DataGrid to file. Pin
Jason Weibel25-May-04 9:28
Jason Weibel25-May-04 9:28 
GeneralRe: Write DataGrid to file. Pin
Heath Stewart25-May-04 9:57
protectorHeath Stewart25-May-04 9:57 
GeneralWisdom of deriving a control from Panel Pin
Joel Holdsworth25-May-04 9:08
Joel Holdsworth25-May-04 9:08 
I need a little help here.

I am writing a winforms control in c#. This control is a non-static control that needs to have a client edge. So I started looking around for a suitable class to derrive the class from. I came up with two options...

1. System.Windows.Forms.Control
The control I'm writing is rather non-standard, and doesn't really resemble any standard controls at all. So i figured that it would be best to derrive from the Control base to make for a nice uncluttered start point. However there's a problem! I need a client edge. I could draw this with the ControlPaint.DrawBorder3D, but the client edge would remain outside this line! I have no way of knowing how much padding the DrawBorder3D adds. I could probably do it by working back into the old Win32 api, but that really defeats the whole purpose of me writing in .net!

2. System.Windows.Forms.Panel
...A second option which has served me well up till this point. Admittedly it has a lot of functionality for things like scrolling which I don't need, but overall it works well. It solves my problem of client borders - it does them automatically! It even provides a BorderStyle property which I _really_ like. It also provides setting for background colors or even background pictures! There's just one problem: System.Windows.Forms.Panel seems to eat keyboard messages before I get to look at them. I overide OnKeyDown, but I just don't recieve any messages!

Can someone tell me there's a way for Panel derrived control to recieve keyboard messages? Or failing that if there's a good way of providing a selection of client borders, and working out their padding, or alternativly if there's another base class that would be better suited to this kind of control?

Joel Holdsworth

Wanna give me a job over the summer?
View my online CV and Job Application[^]
GeneralRe: Wisdom of deriving a control from Panel Pin
ekolis25-May-04 9:19
ekolis25-May-04 9:19 
Generalhmm Pin
Joel Holdsworth25-May-04 9:51
Joel Holdsworth25-May-04 9:51 
GeneralRe: Wisdom of deriving a control from Panel Pin
Heath Stewart25-May-04 10:11
protectorHeath Stewart25-May-04 10:11 
GeneralRe: Wisdom of deriving a control from Panel Pin
Joel Holdsworth25-May-04 10:15
Joel Holdsworth25-May-04 10:15 
GeneralRe: Wisdom of deriving a control from Panel Pin
Joel Holdsworth25-May-04 10:29
Joel Holdsworth25-May-04 10:29 
GeneralDisplay an install date and a print date. Pin
kornstyle25-May-04 9:01
kornstyle25-May-04 9:01 
GeneralRe: Display an install date and a print date. Pin
Heath Stewart25-May-04 9:49
protectorHeath Stewart25-May-04 9:49 
GeneralRe: Display an install date and a print date. Pin
kornstyle25-May-04 11:03
kornstyle25-May-04 11:03 
QuestionCan I send mouse clicks to another application? Pin
ekolis25-May-04 8:52
ekolis25-May-04 8:52 
AnswerRe: Can I send mouse clicks to another application? Pin
Heath Stewart25-May-04 9:43
protectorHeath Stewart25-May-04 9:43 
GeneralRe: Can I send mouse clicks to another application? Pin
ekolis25-May-04 15:05
ekolis25-May-04 15:05 
GeneralRe: Can I send mouse clicks to another application? Pin
Dave Kreskowiak25-May-04 17:14
mveDave Kreskowiak25-May-04 17:14 
GeneralRe: Can I send mouse clicks to another application? Pin
Heath Stewart26-May-04 2:57
protectorHeath Stewart26-May-04 2:57 
GeneralInterop with MSDev 6.0 running instanceS Pin
Eric Marchesin25-May-04 8:52
Eric Marchesin25-May-04 8:52 
GeneralRe: Interop with MSDev 6.0 running instanceS Pin
Heath Stewart25-May-04 10:36
protectorHeath Stewart25-May-04 10:36 
GeneralRe: Interop with MSDev 6.0 running instanceS Pin
Eric Marchesin25-May-04 11:15
Eric Marchesin25-May-04 11:15 
GeneralRe: Interop with MSDev 6.0 running instanceS Pin
Heath Stewart25-May-04 11:20
protectorHeath Stewart25-May-04 11:20 

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.