Introduction
In" kaspersky anti_virus 6.0", there is a component witch is the same as my component
that can shows every texts. There are buttons witch names are "next"&"back"that used
for looking in every texts. I called my component "text wizard".
The way of using
Click on "tool box" with right-click & choose the" choose items ".after add the
'Ehsangolkar.dll'. finally you should drag the textWizard component and drop in your form.
Now it available for using.
White 'Captioncurveradius' property you can change the radius curve. My suggestion for radius curve is '7' default value
In addition, white using 'TextCollectin' you can definite the new items for Textwizard.
TextCollection
How to use :
After clicking on textwizard and adding new item you could change the value items like color, caption box and panel box, caption text caption image, etc.
How to make:
The class as a kind of public has been definition for making text collection witch has inheritance from
System.Collections.CollectionBase class and use
System.Collections.IList interface
You can see the codes of this class here:
public class TextWizardItemCollection : System.Collections.CollectionBase, System.Collections.IList
{
public event CollectionUpdatedEventHandler CollectionUpdated;
public TextWizardItems this[int index]
{
get
{
return (TextWizardItems)List[index];
}
}
public void AddRange(TextWizardItems[] items)
{
foreach (TextWizardItems item in items)
{
this.List.Add(item);
}
OnCollectionUpdated(new EventArgs());
}
public void Add(TextWizardItems item)
{
List.Add(item);
OnCollectionUpdated(new EventArgs());
}
public void Insert(int index, TextWizardItems item)
{
this.List.Insert(index, item);
OnCollectionUpdated(new EventArgs());
}
public void CopyTo(TextWizardItems[] array, int index)
{
this.List.CopyTo(array, index);
}
public int IndexOf(TextWizardItems item)
{
return this.List.IndexOf(item);
}
public void Remove(TextWizardItems value)
{
this.List.Remove(value);
OnCollectionUpdated(new EventArgs());
}
public bool Contains(TextWizardItems value)
{
return this.List.Contains(value);
}
protected virtual void OnCollectionUpdated(EventArgs e)
{
if (CollectionUpdated != null)
{
CollectionUpdated(this, e);
}
}
}
Caption-box
To actually draw the caption box:
GraphicsPath myPath = new GraphicsPath();
Pen myPen = new Pen(outlineColor, 1);
myPath.AddArc(this.Width - captionCurveRadius * 2 - 1, Consts.CaptionOffset,
captionCurveRadius * 2, captionCurveRadius * 2, 270, 90);
myPath.AddArc(this.Width - captionCurveRadius * 2 - 1, Consts.CaptionHeight,
captionCurveRadius * 2, captionCurveRadius * 2, 0, 90);
myPath.AddArc(0, Consts.CaptionHeight, captionCurveRadius * 2 - 1,
captionCurveRadius * 2, 90, 90);
myPath.AddArc(0, Consts.CaptionOffset, captionCurveRadius * 2 - 1,
captionCurveRadius * 2, -180, 90);
myPath.AddLine(captionCurveRadius, Consts.CaptionOffset,
this.Width - captionCurveRadius - 1, Consts.CaptionOffset);
e.Graphics.FillPath(b, myPath);
e.Graphics.DrawPath(myPen, myPath);
Panel-box
GraphicsPath panelPath = new GraphicsPath();
panelPath.AddArc(0, Consts.CaptionHeight, captionCurveRadius * 2 - 1,
captionCurveRadius * 2, 180, -90);
panelPath.AddLine(captionCurveRadius, Consts.CaptionHeight + captionCurveRadius * 2,
this.Width - captionCurveRadius, Consts.CaptionHeight + captionCurveRadius * 2);
panelPath.AddArc(this.Width - captionCurveRadius * 2 - 1, Consts.CaptionHeight,
captionCurveRadius * 2, captionCurveRadius * 2, 90, -90);
panelPath.AddLine(this.Width - 1, Consts.CaptionHeight + captionCurveRadius, this.Width - 1,
this.Height - captionCurveRadius);
panelPath.AddArc(this.Width - captionCurveRadius * 2 - 1,
this.Height - captionCurveRadius * 2 - 1,captionCurveRadius * 2, captionCurveRadius * 2, 0, 90);
panelPath.AddLine(this.Width - captionCurveRadius, this.Height - 1,
captionCurveRadius, this.Height - 1);
panelPath.AddArc(0, this.Height - captionCurveRadius * 2 - 1, captionCurveRadius * 2,
captionCurveRadius * 2, 90, 90);
panelPath.AddLine(0, this.Height - captionCurveRadius - 1, 0, captionCurveRadius - 1);
e.Graphics.DrawPath(myPen, panelPath);
About me
I am student in Islamic azad university Najafabad branch of Iran.
Thanks to Afshin (my brother) for translating the article.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.