Click here to Skip to main content
15,890,506 members
Home / Discussions / C#
   

C#

 
GeneralRe: is there a way?? Pin
tom_dx23-Oct-04 4:39
tom_dx23-Oct-04 4:39 
GeneralRe: is there a way?? Pin
Colin Angus Mackay23-Oct-04 4:41
Colin Angus Mackay23-Oct-04 4:41 
AnswerRe: is there a way?? Pin
Uwe Keim23-Oct-04 4:52
sitebuilderUwe Keim23-Oct-04 4:52 
GeneralRe: is there a way?? Pin
tom_dx23-Oct-04 14:33
tom_dx23-Oct-04 14:33 
Generalpassing a variable value to another form Pin
steve_rm22-Oct-04 20:52
steve_rm22-Oct-04 20:52 
GeneralRe: passing a variable value to another form Pin
Heath Stewart22-Oct-04 21:15
protectorHeath Stewart22-Oct-04 21:15 
GeneralDraw Controls Pin
WDI22-Oct-04 20:32
WDI22-Oct-04 20:32 
GeneralRe: Draw Controls Pin
Heath Stewart22-Oct-04 21:21
protectorHeath Stewart22-Oct-04 21:21 
Read the documentation for Control.OnPaint (inheritted by all controls). You override this method and use the Graphics property of the PaintEventArgs passed to it. Be sure to read the documentation for the Graphics class.

For example, to draw a rectangle just slightly smaller than the bounding rectangle for a control (remember that Form derives from Control, and thus inherits all its properties, methods, fields, and events (members)):
class Form1 : Form
{
  protected override void OnPaint(PaintEventArgs e)
  {
    base.OnPaint(e); // Make sure the base implementation has a chance
                     // to paint, unless you want to handle ALL
                     // painting. See the documentation for
                     // Control.SetStyle in that case.
 
    Rectangle rect = Bounds.Inflace(-5, -5); // Deflate by 5 pixels
                                             // all around.
 
    e.Graphics.DrawRectangle(Pens.Black, rect);
  }
}
For more examples, search this site for "owner drawing" in the C# and .NET categories. There are many articles about this topics on this developer site.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralCentrally managed memory allocation/deallocation Pin
devvvy22-Oct-04 17:51
devvvy22-Oct-04 17:51 
GeneralRe: Centrally managed memory allocation/deallocation Pin
leppie22-Oct-04 20:34
leppie22-Oct-04 20:34 
GeneralRe: Centrally managed memory allocation/deallocation Pin
devvvy22-Oct-04 20:45
devvvy22-Oct-04 20:45 
GeneralRe: Centrally managed memory allocation/deallocation Pin
leppie23-Oct-04 1:45
leppie23-Oct-04 1:45 
GeneralTreeview node images Pin
sachinkalse22-Oct-04 16:26
sachinkalse22-Oct-04 16:26 
GeneralFile IO Pin
StephenMcAllister22-Oct-04 14:06
StephenMcAllister22-Oct-04 14:06 
GeneralRe: File IO Pin
Nick Parker22-Oct-04 15:37
protectorNick Parker22-Oct-04 15:37 
GeneralRe: File IO Pin
StephenMcAllister23-Oct-04 7:47
StephenMcAllister23-Oct-04 7:47 
QuestionHOW TO : BUild Dynamic Templatecolumn. Help Pin
harish h subramanian22-Oct-04 13:53
harish h subramanian22-Oct-04 13:53 
AnswerRe: HOW TO : BUild Dynamic Templatecolumn. Help Pin
Heath Stewart22-Oct-04 21:08
protectorHeath Stewart22-Oct-04 21:08 
Generalplease convert this method :) Pin
SeaMonkey00722-Oct-04 13:42
SeaMonkey00722-Oct-04 13:42 
GeneralRe: please convert this method :) Pin
Paul Lyons22-Oct-04 17:01
Paul Lyons22-Oct-04 17:01 
GeneralRe: please convert this method :) Pin
SeaMonkey00722-Oct-04 20:40
SeaMonkey00722-Oct-04 20:40 
GeneralRe: please convert this method :) Pin
Paul Lyons23-Oct-04 3:48
Paul Lyons23-Oct-04 3:48 
GeneralRe: please convert this method :) Pin
SeaMonkey00723-Oct-04 15:10
SeaMonkey00723-Oct-04 15:10 
GeneralGroup box text will not display an Ampersand Pin
Tony D. Abel22-Oct-04 13:36
Tony D. Abel22-Oct-04 13:36 
GeneralRe: Group box text will not display an Ampersand Pin
Colin Angus Mackay22-Oct-04 13:57
Colin Angus Mackay22-Oct-04 13:57 

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.