Click here to Skip to main content
15,892,059 members
Home / Discussions / C#
   

C#

 
AnswerRe: Dont understand arrays Pin
Migounette9-Apr-10 11:25
Migounette9-Apr-10 11:25 
AnswerRe: Dont understand arrays Pin
Sir Dot Net9-Apr-10 11:26
Sir Dot Net9-Apr-10 11:26 
AnswerRe: Dont understand arrays Pin
AspDotNetDev9-Apr-10 11:35
protectorAspDotNetDev9-Apr-10 11:35 
GeneralRe: Dont understand arrays Pin
Luc Pattyn9-Apr-10 12:24
sitebuilderLuc Pattyn9-Apr-10 12:24 
GeneralRe: Dont understand arrays Pin
AspDotNetDev9-Apr-10 16:12
protectorAspDotNetDev9-Apr-10 16:12 
Questionownerdrawn treenodes Pin
xilefxilef9-Apr-10 10:32
xilefxilef9-Apr-10 10:32 
AnswerRe: ownerdrawn treenodes Pin
NavnathKale9-Apr-10 11:10
NavnathKale9-Apr-10 11:10 
AnswerRe: ownerdrawn treenodes Pin
Migounette9-Apr-10 12:28
Migounette9-Apr-10 12:28 
Maybe this code should help you to understand... :

protected override void OnDrawNode(DrawTreeNodeEventArgs e)


....

if ((e.Node != null) && (e.Node is MyTreeNode))
{
MyTreeNode myTreeNode = e.Node as MyTreeNode;
Rectangle bounds = e.Bounds;

if (myTreeNode.CHECKBOX == true)
{
ControlPaint.DrawCheckBox(e.Graphics, bounds.Left, bounds.Top, 16, 16, ButtonState.Checked);
bounds = Rectangle.Inflate(bounds, 16, 0);
}

// Draw the background and node text for a selected node.
if ((e.State & TreeNodeStates.Selected) != 0)
{
// Draw the background of the selected node. The NodeBounds
// method makes the highlight rectangle large enough to
// include the text of a node tag, if one is present.
e.Graphics.FillRectangle(Brushes.BlueViolet, bounds);

// Retrieve the node font. If the node font has not been set,
// use the TreeView font.
Font nodeFont = e.Node.NodeFont;
if (nodeFont == null) nodeFont = this.Font;

// Draw the node text.
e.Graphics.DrawString(e.Node.Text, nodeFont, Brushes.White, Rectangle.Inflate(bounds, 2, 0));
}
// Use the default background and node text.
else
{
e.DrawDefault = true;
}

// If a node tag is present, draw its string representation
// to the right of the label text.
//e.Graphics.DrawString(e.Node.Tag.ToString(), this.Font,
// Brushes.Yellow, e.Bounds.Right + 2, e.Bounds.Top);

// If the node has focus, draw the focus rectangle large, making
// it large enough to include the text of the node tag, if present.
if ((e.State & TreeNodeStates.Focused) != 0)
{
using (Pen focusPen = new Pen(Color.Black))
{
focusPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
Rectangle focusBounds = bounds;
focusBounds.Size = new Size(focusBounds.Width - 1, focusBounds.Height - 1);
e.Graphics.DrawRectangle(focusPen, focusBounds);
}
}
}
else
{
e.DrawDefault = true;
}
}
GeneralRe: ownerdrawn treenodes Pin
xilefxilef9-Apr-10 13:59
xilefxilef9-Apr-10 13:59 
GeneralRe: ownerdrawn treenodes Pin
DaveyM6910-Apr-10 4:59
professionalDaveyM6910-Apr-10 4:59 
Questiondisabling text selection and cursor blinking in textbox Pin
teknolog1239-Apr-10 8:47
teknolog1239-Apr-10 8:47 
AnswerRe: disabling text selection and cursor blinking in textbox Pin
Dave Kreskowiak9-Apr-10 8:51
mveDave Kreskowiak9-Apr-10 8:51 
GeneralRe: disabling text selection and cursor blinking in textbox Pin
teknolog1239-Apr-10 9:01
teknolog1239-Apr-10 9:01 
AnswerRe: disabling text selection and cursor blinking in textbox Pin
PIEBALDconsult9-Apr-10 10:08
mvePIEBALDconsult9-Apr-10 10:08 
QuestionConvert todatetime (format YYYYMMDD HH:MM:SS) Pin
aleroot9-Apr-10 8:05
aleroot9-Apr-10 8:05 
AnswerRe: Convert todatetime (format YYYYMMDD HH:MM:SS) Pin
Luc Pattyn9-Apr-10 8:19
sitebuilderLuc Pattyn9-Apr-10 8:19 
AnswerRe: Convert todatetime (format YYYYMMDD HH:MM:SS) Pin
Fayu9-Apr-10 9:35
Fayu9-Apr-10 9:35 
QuestionRegEx expression help Pin
Fayu9-Apr-10 6:46
Fayu9-Apr-10 6:46 
AnswerRe: RegEx expression help [modified] Pin
PIEBALDconsult9-Apr-10 7:09
mvePIEBALDconsult9-Apr-10 7:09 
GeneralRe: RegEx expression help Pin
Fayu9-Apr-10 7:12
Fayu9-Apr-10 7:12 
GeneralRe: RegEx expression help Pin
PIEBALDconsult9-Apr-10 7:20
mvePIEBALDconsult9-Apr-10 7:20 
GeneralRe: RegEx expression help Pin
Fayu9-Apr-10 7:45
Fayu9-Apr-10 7:45 
GeneralRe: RegEx expression help Pin
PIEBALDconsult9-Apr-10 7:58
mvePIEBALDconsult9-Apr-10 7:58 
GeneralRe: RegEx expression help Pin
Fayu9-Apr-10 8:14
Fayu9-Apr-10 8:14 
GeneralRe: RegEx expression help Pin
PIEBALDconsult9-Apr-10 8:27
mvePIEBALDconsult9-Apr-10 8:27 

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.