Click here to Skip to main content
15,905,875 members
Home / Discussions / C#
   

C#

 
GeneralRe: Regular Expression validator for currecny Pin
Member 254517629-Apr-09 18:00
Member 254517629-Apr-09 18:00 
QuestionAbout the certification validation period Pin
Roshanakak28-Apr-09 0:56
Roshanakak28-Apr-09 0:56 
QuestionUsing Block - Call Function Pin
dataminers28-Apr-09 0:46
dataminers28-Apr-09 0:46 
AnswerRe: Using Block - Call Function Pin
SeMartens28-Apr-09 0:51
SeMartens28-Apr-09 0:51 
QuestionHelp with drawing Pin
Johnny Jackson28-Apr-09 0:10
Johnny Jackson28-Apr-09 0:10 
AnswerRe: Help with drawing Pin
Henry Minute28-Apr-09 0:32
Henry Minute28-Apr-09 0:32 
AnswerRe: Help with drawing Pin
Bharat Jain28-Apr-09 0:34
Bharat Jain28-Apr-09 0:34 
AnswerRe: Help with drawing Pin
Rob Philpott28-Apr-09 0:56
Rob Philpott28-Apr-09 0:56 
I'd recommend not doing this directly on the form, but deriving a new control from Panel. This control you can place on your form with docking set to fill and it will resize. This way, you gain some portability in your control (for use on other forms). You can even add properties to help define the shape etc.

As far as the drawing goes, there are two handlers you're interested in OnPaint and OnResize. You can hook events for these, or if you do go down the derived control route just override them as protected overrides.

The Resize will just let you know when the control changes size - don't attempt to draw in this. I doubt you even need this really, as you've always got access to the Width and Height in the Paint method. (Actually, you may want to Invalidate() the whole control as the OnPaint handler will clip to just new areas that weren't there prior to the resize - if you need the whole shape to resize you will need to do this).

All drawing should always be done in the OnPaint method. The Width and Height tell you the dimensions. If ever you want to redraw something in Windows, Invalidate() the area and get the OnPaint method to do the drawing.

Regards,
Rob Philpott.

GeneralRe: Help with drawing Pin
Johnny Jackson28-Apr-09 1:40
Johnny Jackson28-Apr-09 1:40 
GeneralRe: Help with drawing Pin
musefan28-Apr-09 2:04
musefan28-Apr-09 2:04 
GeneralRe: Help with drawing Pin
Johnny Jackson28-Apr-09 20:15
Johnny Jackson28-Apr-09 20:15 
GeneralRe: Help with drawing Pin
musefan28-Apr-09 22:01
musefan28-Apr-09 22:01 
GeneralRe: Help with drawing [modified] Pin
Johnny Jackson28-Apr-09 22:57
Johnny Jackson28-Apr-09 22:57 
GeneralRe: Help with drawing Pin
musefan29-Apr-09 2:27
musefan29-Apr-09 2:27 
QuestionCreating Excel Pin
justindhas28-Apr-09 0:08
justindhas28-Apr-09 0:08 
AnswerRe: Creating Excel Pin
Henry Minute28-Apr-09 0:24
Henry Minute28-Apr-09 0:24 
QuestionConverting Word 2007 document to HTML Pin
Sudhir Mangla27-Apr-09 23:29
professionalSudhir Mangla27-Apr-09 23:29 
QuestionVista UAC: run as another user with admin rights Pin
mSh198527-Apr-09 23:22
mSh198527-Apr-09 23:22 
AnswerRe: Vista UAC: run as another user with admin rights Pin
Johnny Jackson28-Apr-09 23:09
Johnny Jackson28-Apr-09 23:09 
AnswerRe: Vista UAC: run as another user with admin rights Pin
mSh198528-Apr-09 23:25
mSh198528-Apr-09 23:25 
QuestionReading media file from a streaming server using a basic directshow player in C# Pin
iFarhan27-Apr-09 23:03
iFarhan27-Apr-09 23:03 
QuestionArgument Pin
BabyOreo27-Apr-09 22:00
BabyOreo27-Apr-09 22:00 
AnswerRe: Argument Pin
Christian Graus27-Apr-09 22:06
protectorChristian Graus27-Apr-09 22:06 
AnswerRe: Argument Pin
musefan27-Apr-09 22:06
musefan27-Apr-09 22:06 
GeneralRe: Argument Pin
CPallini27-Apr-09 22:09
mveCPallini27-Apr-09 22:09 

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.