public static AToolsType LoadSoap(Stream s)
{
try
{
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(ToolsWindowsAssembly.AssemblyResolver);
SoapFormatter b = new SoapFormatter();
b.AssemblyFormat = FormatterAssemblyStyle.Simple;
AToolsType t = b.Deserialize(s) as AToolsType;
return t;
}
finally
{
AppDomain.CurrentDomain.AssemblyResolve -= new ResolveEventHandler(ToolsWindowsAssembly.AssemblyResolver);
}
}
using Syncfusion.Windows.Forms.Tools;
using System.Data;
using System.Windows.Forms;
namespace WFApplication1
{
public partial class Form1 : Form
{
AutoComplete autoComplete1 = new AutoComplete();
TextBox textBox1 = new TextBox();
public Form1()
{
InitializeComponent();
// Set Auto Complete properties for target TextBox
this.autoComplete1.SetAutoComplete(this.textBox1, AutoCompleteModes.AutoSuggest);
this.autoComplete1.ParentForm = this;
//Create a data table
DataTable dt = new DataTable("Table1");
dt.Columns.Add("Country");
dt.Columns.Add("Capital");
// Create a data set
DataSet ds = new DataSet();
ds.Tables.Add(dt);
dt.Rows.Add(new string[] { "United Kingdom ", "London" });
dt.Rows.Add(new string[] { "USA", "Washington, D.C." });
dt.Rows.Add(new string[] { "Brazil", "Brasilia" });
DataView view = new DataView(dt);
// Setting data source to AutoComplete
this.autoComplete1.DataSource = view;
// Added by designer - Add the TextBox to the Form
this.Controls.Add(this.textBox1);
}
}
}
// Add a event to customize data added to history
this.autoComplete1.BeforeAddItem += new AutoCompleteAddItemCancelEventHandler(this.autoComplete1_BeforeAddItem);
// autoComplete1_BeforeAddItem
int columnCount = args.RowItem.Table.Columns.Count;
object [] itemarray = args.RowItem.ItemArray;
string itemText = (string)itemarray[0];// the url field
string nameText = (string)itemarray[1];// The name field
if(itemText.Substring(0,4) == "http")
{
if(nameText == null || nameText == String.Empty)
nameText = "Website";
}
else if(itemText.Substring(0,3) == "ftp")
{
if(nameText == null || nameText == String.Empty)
nameText = "FTP site";
}
else
args.Cancel = true;
itemarray[0] = itemText;
itemarray[1] = nameText;
args.RowItem.ItemArray = itemarray;
this.autoComplete1.SetAutoComplete(this.textBox1, Syncfusion.Windows.Forms.Tools.AutoCompleteModes.AutoSuggest);
AutoCompleteMode mode = this.autoComplete1.GetAutoComplete(this.comboBox1);
if(mode == AutoCompleteMode.Disabled)
this.autoComplete1.SetAutoComplete(this.comboBox1, Syncfusion.Windows.Forms.Tools.AutoCompleteMode.AutoSuggest);
else
this.autoComplete1.SetAutoComplete(this.comboBox1, AutoCompleteMode.Disabled);
private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if (e.KeyChar == '@')
{
this.autoComplete1.CloseDropDown();
}
}
this.autoComplete1.DataSource =this.dataView1 ;
this.autoCompleteDataColumnInfo1 = new Syncfusion.Windows.Forms.Tools.AutoCompleteDataColumnInfo("EmployeeID", 100, true);
this.autoCompleteDataColumnInfo2 = new Syncfusion.Windows.Forms.Tools.AutoCompleteDataColumnInfo("LastName", 100, true);
this.autoCompleteDataColumnInfo3 = new Syncfusion.Windows.Forms.Tools.AutoCompleteDataColumnInfo("BirthDate", 100, true);
this.autoCompleteDataColumnInfo4 = new Syncfusion.Windows.Forms.Tools.AutoCompleteDataColumnInfo("City", 100, true);
this.autoComplete.AutoAddItem = true;
this.autoComplete.AutoSerialize = false;
this.autoComplete.CategoryName = "SomeCategory";
public class Form1 : System.Windows.Forms.Form
{
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.Escape)
{
if (this.ActiveControl == this.autoComplete1.ActiveFocusControl)
{
this.autoComplete1.CloseDropDown();
return true;
}
}
return base.ProcessCmdKey(ref msg, keyData);
}
}
foreach(DataRow dr in this.autoComplete1.TableData.Rows)
{
Console.WriteLine ("Rows "+dr[0]);
}
public class Form1 : System.Windows.Forms.Form
{
private Syncfusion.Windows.Forms.Tools.TabControlAdv TabControlAdv1;
private System.Windows.Forms.Label tab2label1;
private System.Windows.Forms.Button tab3Button;
private System.Windows.Forms.MonthCalendar tab3monthCalendar1;
private System.Windows.Forms.DateTimePicker tab3dateTimePicker1;
private System.Windows.Forms.Label tab3label;
private System.Windows.Forms.Label tab2label2;
private System.Windows.Forms.TextBox tab2textBox1;
private System.Windows.Forms.ListBox tab1listBox1;
private System.Windows.Forms.ComboBox tab1comboBox1;
private System.Windows.Forms.Label tab1label1;
private Syncfusion.Windows.Forms.Tools.TabPageAdv tab1;
private Syncfusion.Windows.Forms.Tools.TabPageAdv tab3;
private Syncfusion.Windows.Forms.Tools.TabPageAdv tab2;
private System.ComponentModel.IContainer components;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.tab2label1 = new System.Windows.Forms.Label();
this.tab1 = new Syncfusion.Windows.Forms.Tools.TabPageAdv();
this.tab1listBox1 = new System.Windows.Forms.ListBox();
this.tab1comboBox1 = new System.Windows.Forms.ComboBox();
this.tab1label1 = new System.Windows.Forms.Label();
this.tab3 = new Syncfusion.Windows.Forms.Tools.TabPageAdv();
this.tab3Button = new System.Windows.Forms.Button();
this.tab3monthCalendar1 = new System.Windows.Forms.MonthCalendar();
this.tab3dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.tab3label = new System.Windows.Forms.Label();
this.tab2 = new Syncfusion.Windows.Forms.Tools.TabPageAdv();
this.tab2label2 = new System.Windows.Forms.Label();
this.tab2textBox1 = new System.Windows.Forms.TextBox();
this.TabControlAdv1 = new Syncfusion.Tools.Windows.Forms.Tab.TabControlAdv();
this.tab1.SuspendLayout();
this.tab3.SuspendLayout();
this.tab2.SuspendLayout();
this.TabControlAdv1.SuspendLayout();
this.SuspendLayout();
//
// tab2label1
//
this.tab2label1.Dock = System.Windows.Forms.DockStyle.Top;
this.tab2label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.tab2label1.Name = "tab2label1";
this.tab2label1.Size = new System.Drawing.Size(373, 48);
this.tab2label1.TabIndex = 0;
this.tab2label1.Text = "Tab2";
this.tab2label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.tab2label1.Paint += new System.Windows.Forms.PaintEventHandler(this.TabPageAdv1_Paint);
//
// tab1
//
this.tab1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.tab1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tab1listBox1,
this.tab1comboBox1,
this.tab1label1});
this.tab1.Location = new System.Drawing.Point(1, 29);
this.tab1.Name = "tab1";
this.tab1.Size = new System.Drawing.Size(373, 257);
this.tab1.TabIndex = 0;
this.tab1.Text = "Tab 1";
this.tab1.ToolTipText = "0asdfasdf";
//
// tab1listBox1
//
this.tab1listBox1.Items.AddRange(new object[] {
"Item 1",
"Item 2",
"Item 3"});
this.tab1listBox1.Location = new System.Drawing.Point(8, 88);
this.tab1listBox1.Name = "tab1listBox1";
this.tab1listBox1.Size = new System.Drawing.Size(192, 147);
this.tab1listBox1.TabIndex = 2;
//
// tab1comboBox1
//
this.tab1comboBox1.DropDownWidth = 192;
this.tab1comboBox1.Location = new System.Drawing.Point(8, 56);
this.tab1comboBox1.Name = "tab1comboBox1";
this.tab1comboBox1.Size = new System.Drawing.Size(192, 21);
this.tab1comboBox1.TabIndex = 1;
this.tab1comboBox1.Text = "comboBox1";
//
// tab1label1
//
this.tab1label1.Dock = System.Windows.Forms.DockStyle.Top;
this.tab1label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.tab1label1.Name = "tab1label1";
this.tab1label1.Size = new System.Drawing.Size(371, 48);
this.tab1label1.TabIndex = 0;
this.tab1label1.Text = "Tab Page 1";
this.tab1label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// tab3
//
this.tab3.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tab3Button,
this.tab3monthCalendar1,
this.tab3dateTimePicker1,
this.tab3label});
this.tab3.Location = new System.Drawing.Point(1, 29);
this.tab3.Name = "tab3";
this.tab3.Size = new System.Drawing.Size(373, 257);
this.tab3.TabIndex = 1;
this.tab3.Text = "Tab 3";
this.tab3.ToolTipText = "2asdfasdf";
this.tab3.Layout += new System.Windows.Forms.LayoutEventHandler(this.TabPageAdv2_Layout);
//
// tab3Button
//
this.tab3Button.Location = new System.Drawing.Point(264, 72);
this.tab3Button.Name = "tab3Button";
this.tab3Button.Size = new System.Drawing.Size(72, 24);
this.tab3Button.TabIndex = 3;
this.tab3Button.Text = "button1";
this.tab3Button.Click += new System.EventHandler(this.button1_Click);
//
// tab3monthCalendar1
//
this.tab3monthCalendar1.Location = new System.Drawing.Point(16, 96);
this.tab3monthCalendar1.Name = "tab3monthCalendar1";
this.tab3monthCalendar1.TabIndex = 2;
//
// tab3dateTimePicker1
//
this.tab3dateTimePicker1.Location = new System.Drawing.Point(8, 64);
this.tab3dateTimePicker1.Name = "tab3dateTimePicker1";
this.tab3dateTimePicker1.TabIndex = 1;
//
// tab3label
//
this.tab3label.Dock = System.Windows.Forms.DockStyle.Top;
this.tab3label.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.tab3label.Name = "tab3label";
this.tab3label.Size = new System.Drawing.Size(373, 48);
this.tab3label.TabIndex = 0;
this.tab3label.Text = "Tab3";
this.tab3label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// tab2
//
this.tab2.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tab2label2,
this.tab2textBox1,
this.tab2label1});
this.tab2.Location = new System.Drawing.Point(1, 29);
this.tab2.Name = "tab2";
this.tab2.Size = new System.Drawing.Size(373, 257);
this.tab2.TabIndex = 2;
this.tab2.Text = "Tab2";
this.tab2.ToolTipText = "1asdfasdfasd";
//
// tab2label2
//
this.tab2label2.Location = new System.Drawing.Point(8, 96);
this.tab2label2.Name = "tab2label2";
this.tab2label2.Size = new System.Drawing.Size(112, 16);
this.tab2label2.TabIndex = 2;
this.tab2label2.Text = "Text Entry:";
//
// tab2textBox1
//
this.tab2textBox1.Location = new System.Drawing.Point(8, 120);
this.tab2textBox1.Multiline = true;
this.tab2textBox1.Name = "tab2textBox1";
this.tab2textBox1.Size = new System.Drawing.Size(368, 80);
this.tab2textBox1.TabIndex = 1;
this.tab2textBox1.Text = "textBox1";
//
// TabControlAdv1
//
this.TabControlAdv1.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right);
this.TabControlAdv1.BackColor = System.Drawing.SystemColors.ActiveBorder;
this.TabControlAdv1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.tab3,
this.tab2,
this.tab1});
this.TabControlAdv1.Cursor = System.Windows.Forms.Cursors.Default;
this.TabControlAdv1.HotTrack = true;
this.TabControlAdv1.ImageList = this.imageList1;
this.TabControlAdv1.ItemSize = new System.Drawing.Size(80, 30);
this.TabControlAdv1.Location = new System.Drawing.Point(40, 16);
this.TabControlAdv1.Name = "TabControlAdv1";
this.TabControlAdv1.ShowToolTips = true;
this.TabControlAdv1.Size = new System.Drawing.Size(376, 288);
this.TabControlAdv1.TabGap = 20;
this.TabControlAdv1.TabIndex = 4;
this.TabControlAdv1.TabStyle = typeof(Syncfusion.Tools.Windows.Forms.Tab.TabRenderer2D);
this.TabControlAdv1.TextAlignment = System.Drawing.StringAlignment.Near;
this.TabControlAdv1.UserMoveTabs = true;
this.TabControlAdv1.VSLikeScrollButton = true;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(688, 309);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.TabControlAdv1});
this.Name = "Form1";
this.Text = "Form1";
this.tab1.ResumeLayout(false);
this.tab3.ResumeLayout(false);
this.tab2.ResumeLayout(false);
this.TabControlAdv1.ResumeLayout(false);
this.ResumeLayout(false);
}
}
Private Function Form1() As Public
'
' Required for Windows Form Designer support
'
InitializeComponent()
End Function
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.tab2label1 = New System.Windows.Forms.Label()
Me.tab1 = New Syncfusion.Windows.Forms.Tools.TabPageAdv()
Me.tab1listBox1 = New System.Windows.Forms.ListBox()
Me.tab1comboBox1 = New System.Windows.Forms.ComboBox()
Me.tab1label1 = New System.Windows.Forms.Label()
Me.tab3 = New Syncfusion.Windows.Forms.Tools.TabPageAdv()
Me.tab3Button = New System.Windows.Forms.Button()
Me.tab3monthCalendar1 = New System.Windows.Forms.MonthCalendar()
Me.tab3dateTimePicker1 = New System.Windows.Forms.DateTimePicker()
Me.tab3label = New System.Windows.Forms.Label()
Me.tab2 = New Syncfusion.Windows.Forms.Tools.TabPageAdv()
Me.tab2label2 = New System.Windows.Forms.Label()
Me.tab2textBox1 = New System.Windows.Forms.TextBox()
Me.TabControlAdv1 = New Syncfusion.Tools.Windows.Forms.Tab.TabControlAdv()
Me.tab1.SuspendLayout()
Me.tab3.SuspendLayout()
Me.tab2.SuspendLayout()
Me.TabControlAdv1.SuspendLayout()
Me.SuspendLayout()
'
' tab2label1
'
Me.tab2label1.Dock = System.Windows.Forms.DockStyle.Top
Me.tab2label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CType((0), System.Byte)))
Me.tab2label1.Name = "tab2label1"
Me.tab2label1.Size = New System.Drawing.Size(373, 48)
Me.tab2label1.TabIndex = 0
Me.tab2label1.Text = "Tab2"
Me.tab2label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
Me.tab2label1.Paint += New System.Windows.Forms.PaintEventHandler(Me.TabPageAdv1_Paint)
'
' tab1
'
Me.tab1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.tab1.Controls.AddRange(New System.Windows.Forms.Control()
{Me.tab1listBox1,Me.tab1comboBox1,Me.tab1label1})
Me.tab1.Location = New System.Drawing.Point(1, 29)
Me.tab1.Name = "tab1"
Me.tab1.Size = New System.Drawing.Size(373, 257)
Me.tab1.TabIndex = 0
Me.tab1.Text = "Tab 1"
Me.tab1.ToolTipText = "0asdfasdf"
'
' tab1listBox1
'
Me.tab1listBox1.Items.AddRange(New System.Windows.Forms.Control()
{Me.tab1listBox1,Me.tab1comboBox1,Me.tab1label1})
Dim Object() As Me.tab1listBox1.Items.AddRange(New string()
{
"Item 1",
"Item 2",
"Item 3"
})
Me.tab1listBox1.Location = New System.Drawing.Point(8, 88)
Me.tab1listBox1.Name = "tab1listBox1"
Me.tab1listBox1.Size = New System.Drawing.Size(192, 147)
Me.tab1listBox1.TabIndex = 2
'
' tab1comboBox1
'
Me.tab1comboBox1.DropDownWidth = 192
Me.tab1comboBox1.Location = New System.Drawing.Point(8, 56)
Me.tab1comboBox1.Name = "tab1comboBox1"
Me.tab1comboBox1.Size = New System.Drawing.Size(192, 21)
Me.tab1comboBox1.TabIndex = 1
Me.tab1comboBox1.Text = "comboBox1"
'
' tab1label1
'
Me.tab1label1.Dock = System.Windows.Forms.DockStyle.Top
Me.tab1label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CType((0), System.Byte)))
Me.tab1label1.Name = "tab1label1"
Me.tab1label1.Size = New System.Drawing.Size(371, 48)
Me.tab1label1.TabIndex = 0
Me.tab1label1.Text = "Tab Page 1"
Me.tab1label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
Me.tab3.Controls.AddRange(New System.Windows.Forms.Control()
{Me.tab3Button,Me.tab3monthCalendar1,Me.tab3dateTimePicker1,Me.tab3label})
Me.tab3.Location = New System.Drawing.Point(1, 29)
Me.tab3.Name = "tab3"
Me.tab3.Size = New System.Drawing.Size(373, 257)
Me.tab3.TabIndex = 1
Me.tab3.Text = "Tab 3"
Me.tab3.ToolTipText = "2asdfasdf"
Me.tab3.Lay+= New System.Windows.Forms.LayoutEventHandler(Me.TabPageAdv2_Layout)
'
' tab3Button
'
Me.tab3Button.Location = New System.Drawing.Point(264, 72)
Me.tab3Button.Name = "tab3Button"
Me.tab3Button.Size = New System.Drawing.Size(72, 24)
Me.tab3Button.TabIndex = 3
Me.tab3Button.Text = "button1"
Me.tab3Button.Click += New System.EventHandler(Me.button1_Click)
'
' tab3monthCalendar1
'
Me.tab3monthCalendar1.Location = New System.Drawing.Point(16, 96)
Me.tab3monthCalendar1.Name = "tab3monthCalendar1"
Me.tab3monthCalendar1.TabIndex = 2
'
' tab3dateTimePicker1
'
Me.tab3dateTimePicker1.Location = New System.Drawing.Point(8, 64)
Me.tab3dateTimePicker1.Name = "tab3dateTimePicker1"
Me.tab3dateTimePicker1.TabIndex = 1
'
' tab3label
'
Me.tab3label.Dock = System.Windows.Forms.DockStyle.Top
Me.tab3label.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, (CType((0), System.Byte)))
Me.tab3label.Name = "tab3label"
Me.tab3label.Size = New System.Drawing.Size(373, 48)
Me.tab3label.TabIndex = 0
Me.tab3label.Text = "Tab3"
Me.tab3label.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
' tab2
'
Me.tab2.Controls.AddRange(New System.Windows.Forms.Control()
{Me.tab2label2,Me.tab2textBox1,Me.tab2label1})
Me.tab2.Location = New System.Drawing.Point(1, 29)
Me.tab2.Name = "tab2"
Me.tab2.Size = New System.Drawing.Size(373, 257)
Me.tab2.TabIndex = 2
Me.tab2.Text = "Tab2"
Me.tab2.ToolTipText = "1asdfasdfasd"
'
' tab2label2
'
Me.tab2label2.Location = New System.Drawing.Point(8, 96)
Me.tab2label2.Name = "tab2label2"
Me.tab2label2.Size = New System.Drawing.Size(112, 16)
Me.tab2label2.TabIndex = 2
Me.tab2label2.Text = "Text Entry:"
'
' tab2textBox1
'
Me.tab2textBox1.Location = New System.Drawing.Point(8, 120)
Me.tab2textBox1.Multiline = True
Me.tab2textBox1.Name = "tab2textBox1"
Me.tab2textBox1.Size = New System.Drawing.Size(368, 80)
Me.tab2textBox1.TabIndex = 1
Me.tab2textBox1.Text = "textBox1"
'
' TabControlAdv1
'
Me.TabControlAdv1.Anchor = (((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right)
Me.TabControlAdv1.Cursor = System.Windows.Forms.Cursors.Default
Me.TabControlAdv1.HotTrack = True
Me.TabControlAdv1.ImageList = Me.imageList1
Me.TabControlAdv1.ItemSize = New System.Drawing.Size(80, 30)
Me.TabControlAdv1.Location = New System.Drawing.Point(40, 16)
Me.TabControlAdv1.Name = "TabControlAdv1"
Me.TabControlAdv1.ShowToolTips = True
Me.TabControlAdv1.Size = New System.Drawing.Size(376, 288)
Me.TabControlAdv1.TabGap = 20
Me.TabControlAdv1.TabIndex = 4
Me.TabControlAdv1.TabStyle = Type.GetType(Syncfusion.Tools.Windows.Forms.Tab.TabRenderer2D)
Me.TabControlAdv1.TextAlignment = System.Drawing.StringAlignment.Near
Me.TabControlAdv1.UserMoveTabs = True
Me.TabControlAdv1.VSLikeScrollButton = True
'
' Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(688, 309)
Me.Controls.AddRange(New System.Windows.Forms.Control()
{Me.TabControlAdv1})
Me.Name = "Form1"
Me.Text = "Form1"
Me.tab1.ResumeLayout(False)
Me.tab3.ResumeLayout(False)
Me.tab2.ResumeLayout(False)
Me.TabControlAdv1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
//Loading TabState from xml file(TabState.xml located in Application folder)
AppStateSerializer serializer = new AppStateSerializer(SerializeMode.XMLFile, "TabState");
this.tabControlAdv1.LoadState(serializer);
'Loading TabState from xml file(TabState.xml located in Application folder)
Dim serializer As New AppStateSerializer(SerializeMode.XMLFile, "TabState")
Me.tabControlAdv1.LoadState(serializer)
//Saving TabState to xml file(TabState.xml located in Application folder)
AppStateSerializer serializer =new AppStateSerializer(SerializeMode.XMLFile, "TabState");
this.tabControlAdv1.SaveState(serializer);
serializer.PersistNow();
'Saving TabState to xml file(TabState.xml located in Application folder)
Dim serializer As New AppStateSerializer(SerializeMode.XMLFile, "TabState")
Me.tabControlAdv1.SaveState(serializer)
serializer.PersistNow()
public Form1()
{
this.tabPage1 = new TabPageAdv();
// Invokes the TabControlAdv() constructor to create the tabControl1 object.
this.tabControl1 = new TabControlAdv();
this.tabControl1.Controls.Add(tabPage1);
this.Controls.Add(tabControl1);
}
Public Sub New()
Me.tabPage1 = New TabPageAdv()
' Invokes the TabControlAdv() constructor to create the tabControl1 object.
Me.tabControl1 = New TabControlAdv()
Me.tabControl1.Controls.Add(tabPage1)
Me.Controls.Add(tabControl1)
End Sub 'New
// Make sure to set the "3D" tab style, turn on the HotTrack property and handle
// the DrawItem event of the tab control.
private void InitializeComponent()
{
....
this.TabControlAdv1.HotTrack = true;
this.TabControlAdv1.TabStyle = typeof(Syncfusion.Windows.Forms.Tools.TabRenderer3D);
this.TabControlAdv1.DrawItem += new Syncfusion.Windows.Forms.Tools.DrawTabEventHandler(this.Tab_DrawItemYahooMessengerLike);
....
}
private void Tab_DrawItemYahooMessengerLike(object sender, DrawTabEventArgs drawItemInfo)
{
// Draw the default background and interior in all cases.
drawItemInfo.DrawBackground();
drawItemInfo.DrawInterior();
// The border should be drawn only when the item is selected or highlighted.
if(((int)drawItemInfo.State & ((int)DrawItemState.Selected | (int)DrawItemState.HotLight)) > 0)
{
// Draw the borders
drawItemInfo.DrawBorders();
}
}
' Make sure to set the "3D" tab style, turn on the HotTrack property and handle
' the DrawItem event of the tab control.
Private Sub InitializeComponent()
Me.TabControlAdv1.HotTrack = True
Me.TabControlAdv1.TabStyle = GetType(Syncfusion.Windows.Forms.Tools.TabRenderer3D)
Me.TabControlAdv1.DrawItem += New Syncfusion.Windows.Forms.Tools.DrawTabEventHandler(Me.Tab_DrawItemYahooMessengerLike)
End Sub 'InitializeComponent
Private Sub Tab_DrawItemYahooMessengerLike(sender As Object, drawItemInfo As DrawTabEventArgs)
' Draw the default background and interior in all cases.
drawItemInfo.DrawBackground()
drawItemInfo.DrawInterior()
' The border should be drawn only when the item is selected or highlighted.
If(CInt(drawItemInfo.State) And(CInt(DrawItemState.Selected) Or CInt(DrawItemState.HotLight))) > 0 Then
' Draw the borders
drawItemInfo.DrawBorders()
End If
End Sub 'Tab_DrawItemYahooMessengerLike
private void InitMyTabs()
{
this.tabControl1 = new TabControlAdv();
this.tabPage1 = new TabPageAdv();
this.tabPage2 = new TabPageAdv();
this.tabPage3 = new TabPageAdv();
// Positions tabs on the left side of tabControl1.
// this.tabControl1.Alignment = System.Windows.Forms.TabAlignment.Left;
// Sets the tabs to appear in 2D mode.
tabControl1.TabStyle = typeof(TabRenderer2D);
// Highlights TabPage.Text when the mouse passes over tabs.
this.tabControl1.HotTrack = true;
// Set the relative alignment between the images and text in a tab
this.tabControl1.ImageAlignmentR = RelativeImageAlignment.BelowText;
// Allows more than one row of tabs.
// this.tabControl1.Multiline = true;
// Creates a cushion of 22 pixels around TabPage.Text strings.
this.tabControl1.Padding = new System.Drawing.Point(22, 22);
// Makes the tab width definable.
this.tabControl1.SizeMode = Syncfusion.Windows.Forms.Tools.TabSizeMode.Fixed;
// Sizes the tabs of tabControl1.
this.tabControl1.ItemSize = new Size(90, 64); // Make sure to take into account the padding values.
// To rotate text when aligned vertically.
this.tabControl1.RotateTextWhenVertical = true;
// Allows the user to move the tabs by simply dragging and dropping
this.tabControl1.UserMoveTabs = true;
// Draws the scroll buttons Visual Studio MDI Tabs like.
this.tabControl1.VSLikeScrollButton = true;
this.tabControl1.Controls.AddRange(new Control[] {
this.tabPage1,
this.tabPage2,
this.tabPage3});
this.tabControl1.Location = new Point(16, 24);
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new Size(248, 232);
this.tabPage1.Text = "Tab1";
this.tabPage2.Text = "Tab2";
this.tabPage3.Text = "Tab3";
this.Size = new Size(300,300);
this.Controls.AddRange(new Control[] {
this.tabControl1});
// Selects tabPage1 using SelectedIndex.
this.tabControl1.SelectedIndex = 1;
// Shows ToolTipText when the mouse passes over tabs.
this.tabControl1.ShowToolTips = true;
}
Private Sub InitMyTabs()
Me.tabControl1 = New TabControlAdv()
Me.tabPage1 = New TabPageAdv()
Me.tabPage2 = New TabPageAdv()
Me.tabPage3 = New TabPageAdv()
' Positions tabs on the left side of tabControl1.
' this.tabControl1.Alignment = System.Windows.Forms.TabAlignment.Left;
' Sets the tabs to appear in 2D mode.
tabControl1.TabStyle = GetType(TabRenderer2D)
' Highlights TabPage.Text when the mouse passes over tabs.
Me.tabControl1.HotTrack = True
' Set the relative alignment between the images and text in a tab
Me.tabControl1.ImageAlignmentR = RelativeImageAlignment.BelowText
' Allows more than one row of tabs.
' this.tabControl1.Multiline = true;
' Creates a cushion of 22 pixels around TabPage.Text strings.
Me.tabControl1.Padding = New System.Drawing.Point(22, 22)
' Makes the tab width definable.
Me.tabControl1.SizeMode = Syncfusion.Windows.Forms.Tools.TabSizeMode.Fixed
' Sizes the tabs of tabControl1.
Me.tabControl1.ItemSize = New Size(90, 64)
' Make sure to take into account the padding values.
' To rotate text when aligned vertically.
Me.tabControl1.RotateTextWhenVertical = True
' Allows the user to move the tabs by simply dragging and dropping
Me.tabControl1.UserMoveTabs = True
' Draws the scroll buttons Visual Studio MDI Tabs like.
Me.tabControl1.VSLikeScrollButton = True
Me.tabControl1.Controls.AddRange(New Control() {Me.tabPage1, Me.tabPage2, Me.tabPage3})
Me.tabControl1.Location = New Point(16, 24)
Me.tabControl1.SelectedIndex = 0
Me.tabControl1.Size = New Size(248, 232)
Me.tabPage1.Text = "Tab1"
Me.tabPage2.Text = "Tab2"
Me.tabPage3.Text = "Tab3"
Me.Size = New Size(300, 300)
Me.Controls.AddRange(New Control() {Me.tabControl1})
' Selects tabPage1 using SelectedIndex.
Me.tabControl1.SelectedIndex = 1
' Shows ToolTipText when the mouse passes over tabs.
Me.tabControl1.ShowToolTips = True
End Sub
public Form1()
{
this.tabControl1 = new TabControlAdv();
// Invokes the TabPage() constructor to create the tabPage1 object.
this.tabPage1 = new Syncfusion.Windows.Forms.Tools.TabPageAdv();
this.tabControl1.Controls.AddRange(new Control[] {
this.tabPage1});
this.tabControl1.Location = new Point(25, 25);
this.tabControl1.Size = new Size(250, 250);
this.ClientSize = new Size(300, 300);
this.Controls.AddRange(new Control[] {
this.tabControl1});
}
Public Sub New()
Me.tabControl1 = New TabControlAdv()
' Invokes the TabPage() constructor to create the tabPage1 object.
Me.tabPage1 = New Syncfusion.Windows.Forms.Tools.TabPageAdv()
Me.tabControl1.Controls.AddRange(New Control() {Me.tabPage1})
Me.tabControl1.Location = New Point(25, 25)
Me.tabControl1.Size = New Size(250, 250)
Me.ClientSize = New Size(300, 300)
Me.Controls.AddRange(New Control() {Me.tabControl1})
End Sub 'New
public void MyTabs()
{
this.tabControl1 = new TabControlAdv();
// Invokes the TabPageAdv() constructor to create the tabPage1 object.
this.tabPage1 = new Syncfusion.Windows.Forms.ToolsTabPageAdv();
this.tabControl1.Controls.Add(tabPage1);
this.Controls.Add(tabControl1);
}
public Form1()
{
MyTabs();
}
public void MyTabs()
{
this.tabControl1 = new TabControlAdv();
string tabPageName = "myTabPage";
// Invokes the TabPageAdv() constructor to create the tabPage1 object.
this.tabPage1 = new Syncfusion.Windows.Forms.Tools.TabPageAdv(tabPageName);
this.tabControl1.Controls.Add(tabPage1);
this.Controls.Add(tabControl1);
}
public Form1()
{
MyTabs();
}
//InitializeComponent
// Create the Calculator Control
this.calculatorControl1 = new CalculatorControl();
this.textBox1 = new TextBox();
// Set the value of the calculator control
this.calculatorControl1.DoubleValue = 0;
// Set the border style for the control
this.calculatorControl1.BorderStyle = Border3DStyle.Raised;
// The flat style for the buttons
this.calculatorControl1.FlatStyle = FlatStyle.Standard;
// Set the size of the calculator
this.calculatorControl1.Size = new System.Drawing.Size(288, 232);
// Add a event handler for the ValueCalculated event of the child button
this.calculatorControl1.ValueCalculated += new Syncfusion.Windows.Forms.Tools.CalculatorControl.ValueCalculatedEventHandler(this.CodeGen_calculatorControl1_ValueCalculated);
// Add the CalculatorControl control to the form
this.Controls.Add(this.calculatorControl1);
'InitializeComponent
' Create the Calculator Control
Me.calculatorControl1 = New CalculatorControl()
Me.textBox1 = New TextBox()
' Set the value of the calculator control
Me.calculatorControl1.DoubleValue = 0
' Set the border style for the control
Me.calculatorControl1.BorderStyle = Border3DStyle.Raised
' The flat style for the buttons
Me.calculatorControl1.FlatStyle = FlatStyle.Standard
' Set the size of the calculator
Me.calculatorControl1.Size = New System.Drawing.Size(288, 232)
' Add a event handler for the ValueCalculated event of the child button
AddHandler Me.calculatorControl1.ValueCalculated, New Syncfusion.Windows.Forms.Tools.CalculatorControl.ValueCalculatedEventHandler(AddressOf CodeGen_calculatorControl1_ValueCalculated)
' Add the CalculatorControl control to the form
Me.Controls.Add(Me.calculatorControl1)
this.calculatorControl1.ValueCalculated += new Syncfusion.Windows.Forms.Tools.CalculatorControl.ValueCalculatedEventHandler(this.CodeGen_calculatorControl1_ValueCalculated);
calculatorControl1_ValueCalculated
if(arg.ErrorCondition == false)
this.textBox1.Text = arg.Value.ToString();
else
this.textBox1.Text = arg.Message;
AddHandler Me.calculatorControl1.ValueCalculated, New Syncfusion.Windows.Forms.Tools.CalculatorControl.ValueCalculatedEventHandler(AddressOf CodeGen_calculatorControl1_ValueCalculated)
'calculatorControl1_ValueCalculated
If (arg.ErrorCondition = False) Then
Me.textBox1.Text = arg.Value.ToString
Else
Me.textBox1.Text = arg.Message
End If
// CurrencyEdit control
this.currencyEdit1 = new Syncfusion.Windows.Forms.Tools.CurrencyEdit();
//
// currencyEdit1
//
this.currencyEdit1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.currencyEdit1.Location = new System.Drawing.Point(16, 80);
this.currencyEdit1.Name = "currencyEdit1";
this.currencyEdit1.SelectionLength = 0;
this.currencyEdit1.SelectionStart = 5;
this.currencyEdit1.ShowCalculator = true;
this.currencyEdit1.ShowTextBox = true;
this.currencyEdit1.Size = new System.Drawing.Size(304, 22);
this.currencyEdit1.TabIndex = 1;
this.currencyEdit1.Text = "$1.00";
this.currencyEdit1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
// Add the CurrencyEdit control to the form
this.Controls.Add(this.currencyEdit1);
' CurrencyEdit control
Me.currencyEdit1 = New Syncfusion.Windows.Forms.Tools.CurrencyEdit
'
' currencyEdit1
'
Me.currencyEdit1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.currencyEdit1.Location = New System.Drawing.Point(16, 80)
Me.currencyEdit1.Name = "currencyEdit1"
Me.currencyEdit1.SelectionLength = 0
Me.currencyEdit1.SelectionStart = 5
Me.currencyEdit1.ShowCalculator = true
Me.currencyEdit1.ShowTextBox = true
Me.currencyEdit1.Size = New System.Drawing.Size(304, 22)
Me.currencyEdit1.TabIndex = 1
Me.currencyEdit1.Text = "$1.00"
Me.currencyEdit1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
' Add the CurrencyEdit control to the form
Me.Controls.Add(Me.currencyEdit1)
// InitializeComponent sample
this.buttonEdit1 = new Syncfusion.Windows.Forms.Tools.ButtonEdit();
this.buttonEditChildButton1 = new Syncfusion.Windows.Forms.Tools.ButtonEditChildButton();
this.buttonEdit1.SuspendLayout();
this.SuspendLayout();
this.buttonEdit1.Buttons.Add(this.buttonEditChildButton1);
this.buttonEdit1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.buttonEditChildButton1});
this.buttonEdit1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonEdit1.Location = new System.Drawing.Point(8, 16);
this.buttonEdit1.Name = "buttonEdit1";
this.buttonEdit1.SelectionLength = 0;
this.buttonEdit1.SelectionStart = 0;
this.buttonEdit1.ShowTextBox = true;
this.buttonEdit1.Size = new System.Drawing.Size(368, 22);
this.buttonEdit1.TabIndex = 0;
this.buttonEdit1.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
//
// buttonEditChildButton1
//
this.buttonEditChildButton1.ButtonAlign = Syncfusion.Windows.Forms.Tools.ButtonAlignment.Right;
this.buttonEditChildButton1.ButtonEditParent = this.buttonEdit1;
this.buttonEditChildButton1.ButtonType = Syncfusion.Windows.Forms.Tools.ButtonTypes.Browse;
this.buttonEditChildButton1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonEditChildButton1.Location = new System.Drawing.Point(352, 0);
this.buttonEditChildButton1.Name = "buttonEditChildButton1";
this.buttonEditChildButton1.PreferredWidth = 16;
this.buttonEditChildButton1.Size = new System.Drawing.Size(16, 22);
this.buttonEditChildButton1.TabIndex = 1;
this.buttonEditChildButton1.Click += new System.EventHandler(this.buttonEditChildButton1_Click);
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(400, 273);
this.Controls.AddRange(new System.Windows.Forms.Control[] { this.buttonEdit1});
this.Text = "Syncfusion ButtonEdit Demo";
this.buttonEdit1.ResumeLayout(false);
this.ResumeLayout(false);
' InitializeComponent sample
Me.buttonEdit1 = New Syncfusion.Windows.Forms.Tools.ButtonEdit()
Me.buttonEditChildButton1 = New Syncfusion.Windows.Forms.Tools.ButtonEditChildButton()
Me.buttonEdit1.SuspendLayout()
Me.SuspendLayout()
Me.buttonEdit1.Buttons.Add(Me.buttonEditChildButton1)
Me.buttonEdit1.Controls.AddRange(New System.Windows.Forms.Control() {Me.buttonEditChildButton1})
Me.buttonEdit1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.buttonEdit1.Location = New System.Drawing.Point(8, 16)
Me.buttonEdit1.Name = "buttonEdit1"
Me.buttonEdit1.SelectionLength = 0
Me.buttonEdit1.SelectionStart = 0
Me.buttonEdit1.ShowTextBox = True
Me.buttonEdit1.Size = New System.Drawing.Size(368, 22)
Me.buttonEdit1.TabIndex = 0
Me.buttonEdit1.TextAlign = System.Windows.Forms.HorizontalAlignment.Left
'
' buttonEditChildButton1
'
Me.buttonEditChildButton1.ButtonAlign = Syncfusion.Windows.Forms.Tools.ButtonAlignment.Right
Me.buttonEditChildButton1.ButtonEditParent = Me.buttonEdit1
Me.buttonEditChildButton1.ButtonType = Syncfusion.Windows.Forms.Tools.ButtonTypes.Browse
Me.buttonEditChildButton1.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.buttonEditChildButton1.Location = New System.Drawing.Point(352, 0)
Me.buttonEditChildButton1.Name = "buttonEditChildButton1"
Me.buttonEditChildButton1.PreferredWidth = 16
Me.buttonEditChildButton1.Size = New System.Drawing.Size(16, 22)
Me.buttonEditChildButton1.TabIndex = 1
AddHandler Me.buttonEditChildButton1.Click, New System.EventHandler(AddressOf buttonEditChildButton1_Click)
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(400, 273)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.buttonEdit1})
Me.Text = "Syncfusion ButtonEdit Demo"
Me.buttonEdit1.ResumeLayout(False)
Me.ResumeLayout(False)
Console.WriteLine("ValidationError in currencyTextBox1 InvalidText" + e.InvalidText);
Console.WriteLine("ValidationError in currencyTextBox1 StartPosition" + e.StartPosition );
Console.WriteLine(("ValidationError in currencyTextBox1 InvalidText" + e.InvalidText))
Console.WriteLine(("ValidationError in currencyTextBox1 StartPosition" + e.StartPosition))
Font newFont = new Font(this.fontCombo.Text, 10.0);
Font newFont = new Font(this.fontCombo.Text, 10.0);
Font newFont = new Font(this.fontListBox.Text, 10.0);
This combo box is meant to be used in data bound mode where it will show all the records and the different fields in the data source in a multi column grid, in the dropdown.
Data binding is done as usual through the
If you bind an array of objects of custom type then the public properties in that type will correspond to each column in the dropdown multi-column grid.
Note that in this version you cannot populate the
// InitializeComponent
// Create the Gradient Label
this.gradientLabel1 = new GradientLabel();
// Set formatting properties
this.gradientLabel1.Text = "Essential Suite Gradient Label";
this.gradientLabel1.BackgroundColor = new BrushInfo(Syncfusion.Drawing.GradientStyle.Vertical, System.Drawing.SystemColors.Highlight, System.Drawing.SystemColors.HighlightText);
this.gradientLabel1.BorderStyle = Border3DStyle.Etched;
this.gradientLabel1.Font = new Font("Microsoft Sans Serif", 14.25F, (System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic), System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.gradientLabel1.Location = new Point(24, 16);
this.gradientLabel1.Name = "gradientLabel1";
this.gradientLabel1.Size = new Size(440, 56);
this.gradientLabel1.TextAlign = ContentAlignment.MiddleCenter;
// Add the GradientLabel control to the form
this.Controls.Add(this.gradientLabel1);
' InitializeComponent
' Create the GradientLabel control.
Me.gradientLabel1 = New GradientLabel()
' Set formatting properties
Me.gradientLabel1.Text = "Essential Suite Gradient Label"
Me.gradientLabel1.BackgroundColor = New BrushInfo(Syncfusion.Drawing.GradientStyle.Vertical, System.Drawing.SystemColors.Highlight, System.Drawing.SystemColors.HighlightText)
Me.gradientLabel1.BorderStyle = Border3DStyle.Etched
Me.gradientLabel1.Font = New Font("Microsoft Sans Serif", 14.25!, (System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Italic), System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.gradientLabel1.Location = New Point(24, 16)
Me.gradientLabel1.Name = "gradientLabel1"
Me.gradientLabel1.Size = New Size(440, 56)
Me.gradientLabel1.TextAlign = ContentAlignment.MiddleCenter
' Add the GradientLabel control to the form
Me.Controls.Add(Me.gradientLabel1)
The CollapseAll method collapses all the
The state of a TreeNodeAdv persists. For example, suppose that a parent tree node is expanded. If the child tree nodes were not previously collapsed, they will appear in their previously-expanded state. Calling the CollapseAll method ensures that all the tree nodes appear in the collapsed state.
The ExpandAll method expands all the
The CancelEditMode method cancels the edit mode when the node is in the EditingMode.
private void button1_Click(object sender, System.EventArgs e)
{
//Call the tree control's "GetNodeCount" method with true to
//get the total number of nodes in the tree
int TotalNodesInTree = this.treeViewAdv1.GetNodeCount( true );
MessageBox.Show( "Total nodes in tree = " + TotalNodesInTree.ToString());
}
//Add nodes
private void button2_Click(object sender, System.EventArgs e)
{
this.treeViewAdv1.SelectedNode.Nodes.Add(new TreeNodeAdv());
}
//Remove nodes
private void button3_Click(object sender, System.EventArgs e)
{
this.treeViewAdv1.SelectedNode.Parent.Nodes.Remove(this.treeViewAdv1.SelectedNode);
}
Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
' Call the tree control's "GetNodeCount" method with true to
' get the total number of nodes in the tree
Dim TotalNodesInTree As Integer = Me.treeViewAdv1.GetNodeCount(True)
MessageBox.Show("Total nodes in tree = " & TotalNodesInTree.ToString())
End Sub
'Add nodes
Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Me.treeViewAdv1.SelectedNode.Nodes.Add(New TreeNodeAdv())
End Sub
'Remove nodes
Private Sub button3_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Me.treeViewAdv1.SelectedNode.Parent.Nodes.Remove(Me.treeViewAdv1.SelectedNode)
End Sub
If SortWithChildNodes property is set to true,the user can sort all the nodes including all the child nodes in the treeViewAdv.
The SortOrder of the Root should be specified for the sorting all nodes.
// Sorts only the root nodes.
private void button1_Click(object sender, System.EventArgs e)
{
this.treeViewAdv1.Nodes.Sort();
}
// Sort all the root nodes and the child nodes in the TreeviewAdv
private void button2_Click_1(object sender, System.EventArgs e)
{
this.treeViewAdv1.Root.SortOrder=SortOrder.Ascending;
this.treeViewAdv1.SortWithChildNodes=true;
this.treeViewAdv1.Root.Sort();
}
'Sorts only the root nodes.
Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Me.treeViewAdv1.Nodes.Sort()
End Sub
'Sort all the root nodes and the child nodes in the TreeviewAdv
Private Sub button2_Click_1(ByVal sender As Object, ByVal e As System.EventArgs)
Me.treeViewAdv1.Root.SortOrder=SortOrder.Ascending
Me.treeViewAdv1.SortWithChildNodes=True
Me.treeViewAdv1.Root.Sort()
End Sub
The Item property in the argument is an array of MultiColumnTreeView nodes that are currently selected.
You can choose to initiate an ole drag-and-drop operation in this event handler.
// MultiColumnTreeView.ItemDrag event listener
private void treeViewAdv1_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e)
{
// Begin a drag and drop operation of the selected nodes (or some other data).
TreeNodeAdv[] nodes = e.Item as TreeNodeAdv[];
DragDropEffects result = this.DoDragDrop(nodes, DragDropEffects.Copy | DragDropEffects.Move);
// more app logic based on result...
}
' MultiColumnTreeView.ItemDrag event listener
Private Sub treeViewAdv1_ItemDrag(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemDragEventArgs) Handles treeViewAdv2.ItemDrag
' Begin a drag and drop operation of the selected nodes (or some other data).
Dim nodes As TreeNodeAdv() = CType(e.Item, TreeNodeAdv())
Dim result As DragDropEffects = Me.DoDragDrop(nodes, DragDropEffects.Copy Or DragDropEffects.Move)
' more app logic based on result...
End Sub 'treeViewAdv1_ItemDrag '
BeginBlock();
// add action1
// .....
BeginBlock();
//......
EndBlock();
// add actionN
CloseBlock();
// Create and initialize a ParentBarItem
this.editBarItem = new Syncfusion.Windows.Forms.Tools.ParentBarItem();
this.editMenu.Text = "Edit";
this.editMenu.Items.AddRange(new BarItem[]
{ this.cutItem,
this.copyItem,});
// Associate the ParentBarItem with the PopupMenu
this.popupMenu1 = new Syncfusion.Windows.Forms.Tools.PopupMenu();
this.popupMenu1.ParentBarItem = this. editBarItem;
// Then associate it with a RichTextBox
this.popupMenusManager = new PopupMenusManager();
this.popupMenusManager.SetXPContextMenu(this.richTextBox1, this.popupMenu1);
' Create and initialize a ParentBarItem
Me.editBarItem = New Syncfusion.Windows.Forms.Tools.ParentBarItem()
Me.editMenu.Text = "Edit"
Me.editMenu.Items.AddRange(New BarItem() {Me.cutItem, Me.copyItem})
' Associate the ParentBarItem with the PopupMenu
Me.popupMenu1 = New Syncfusion.Windows.Forms.Tools.PopupMenu()
Me.popupMenu1.ParentBarItem = Me.editBarItem
' Then associate it with a RichTextBox
Me.popupMenusManager = New PopupMenusManager()
Me.popupMenusManager.SetXPContextMenu(Me.richTextBox1, Me.popupMenu1)
this.ribbonControlAdv1.ThemeStyle.FileMenuForeColor = Color.Yellow;
this.ribbonControlAdv1.ThemeStyle.FileMenuBackColor = Color.Yellow;
this.ribbonControlAdv1.ThemeStyle.FileMenuHoverBackColor = Color.Yellow;
RibbonControlAdv myRibbon = new RibbonControlAdv();
myRibbon. EnableSimplifiedLayoutMode = true;
public override StyleInfoSubObjectIdentity CreateSubObjectIdentity(StyleInfoProperty sip)
{
return new FormVisualStyleInfoSubObjectIdentity(this, sip);
}
public override StyleInfoSubObjectIdentity CreateSubObjectIdentity(StyleInfoProperty sip)
{
return new FormVisualStyleInfoSubObjectIdentity(this, sip);
}
The CollapseAll method collapses all the
The state of a TreeNodeAdv persists. For example, suppose that a parent tree node is expanded. If the child tree nodes were not previously collapsed, they will appear in their previously-expanded state. Calling the CollapseAll method ensures that all the tree nodes appear in the collapsed state.
The ExpandAll method expands all the
The CancelEditMode method cancels the edit mode when the node is in the EditingMode.
private void button1_Click(object sender, System.EventArgs e)
{
//Call the tree control's "GetNodeCount" method with true to
//get the total number of nodes in the tree
int TotalNodesInTree = this.treeViewAdv1.GetNodeCount( true );
MessageBox.Show( "Total nodes in tree = " + TotalNodesInTree.ToString());
}
//Add nodes
private void button2_Click(object sender, System.EventArgs e)
{
this.treeViewAdv1.SelectedNode.Nodes.Add(new TreeNodeAdv());
}
//Remove nodes
private void button3_Click(object sender, System.EventArgs e)
{
this.treeViewAdv1.SelectedNode.Parent.Nodes.Remove(this.treeViewAdv1.SelectedNode);
}
Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
' Call the tree control's "GetNodeCount" method with true to
' get the total number of nodes in the tree
Dim TotalNodesInTree As Integer = Me.treeViewAdv1.GetNodeCount(True)
MessageBox.Show("Total nodes in tree = " & TotalNodesInTree.ToString())
End Sub
'Add nodes
Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Me.treeViewAdv1.SelectedNode.Nodes.Add(New TreeNodeAdv())
End Sub
'Remove nodes
Private Sub button3_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Me.treeViewAdv1.SelectedNode.Parent.Nodes.Remove(Me.treeViewAdv1.SelectedNode)
End Sub
The Item property in the argument is an array of TreeViewAdv nodes that are currently selected.
You can choose to initiate an ole drag-and-drop operation in this event handler.
// TreeViewAdv.ItemDrag event listener
private void treeViewAdv1_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e)
{
// Begin a drag and drop operation of the selected nodes (or some other data).
TreeNodeAdv[] nodes = e.Item as TreeNodeAdv[];
DragDropEffects result = this.DoDragDrop(nodes, DragDropEffects.Copy | DragDropEffects.Move);
// more application logic based on result...
}
' TreeViewAdv.ItemDrag event listener
Private Sub treeViewAdv1_ItemDrag(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemDragEventArgs) Handles treeViewAdv2.ItemDrag
' Begin a drag and drop operation of the selected nodes (or some other data).
Dim nodes As TreeNodeAdv() = CType(e.Item, TreeNodeAdv())
Dim result As DragDropEffects = Me.DoDragDrop(nodes, DragDropEffects.Copy Or DragDropEffects.Move)
' more application logic based on result...
End Sub 'treeViewAdv1_ItemDrag '
If SortWithChildNodes property is set to true,the user can sort all the nodes including all the child nodes in the treeViewAdv.
The SortOrder of the Root should be specified for the sorting all nodes.
//Sorts only the root nodes.
private void button1_Click(object sender, System.EventArgs e)
{
this.treeViewAdv1.Nodes.Sort();
}
//Sort all the root nodes and the child nodes in the TreeviewAdv
private void button2_Click_1(object sender, System.EventArgs e)
{
this.treeViewAdv1.Root.SortOrder=SortOrder.Ascending;
this.treeViewAdv1.SortWithChildNodes=true;
this.treeViewAdv1.Root.Sort();
}
'Sorts only the root nodes.
Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Me.treeViewAdv1.Nodes.Sort()
End Sub
'Sort all the root nodes and the child nodes in the TreeviewAdv
Private Sub button2_Click_1(ByVal sender As Object, ByVal e As System.EventArgs)
Me.treeViewAdv1.Root.SortOrder=SortOrder.Ascending
Me.treeViewAdv1.SortWithChildNodes=True
Me.treeViewAdv1.Root.Sort()
End Sub
TreeViewAdv treeViewAdv1 = new TreeViewAdv();
treeViewAdv1.DisplayMember = "Place";
treeViewAdv1.ParentMember = "ParentID";
treeViewAdv1.ChildMember = "ChildID";
treeViewAdv1.DataSource = dataTable2;
//Sets the selected item form datatable
treeViewAdv1.SelectedItem = dataTable2.Rows[1];
The following example shows how to set the value of the SelectedItem property.
The Essential Tools Docking Windows framework enables developers to add docking windows, similar to those found in the Microsoft Visual Studio.NET IDE, to their Windows Forms applications. At the most basic level a docking window may be defined as a control that attaches itself to a host form's border, is capable of being dragged around and docked to different edges within the form and can also be dragged off the host form and floated as an individual top-level window. The docking framework allows just about any child control on a form to be made into a fully qualified docking window. The framework, in addition to the core docking interactions, implements some highly advanced features such as multiple docking levels, nested docking, tabbed docking, tear-off tabs, autohide mode, state persistence etc. To facilitate the addition of these complex features, the DockingManager has a full-fledged WYSIWYG visual designer that enables developers to create the exact docking layout that they desire without having to write a single line of code.
The DockingManager class is the central component of the Essential Tools Docking Windows implementation. The class coordinates and facilitates the multitude of complex interactions that take place between a dockable control and it's host form as well as between the dockable controls themselves. DockingManagers are form-centric and adding an instance of the component to a form makes the form into a 'dock-enabled' host. The DockingManager is implemented as an Extender Provider and upon adding it to a Form or UserControl, the controls that are immediate children of the container qualify for the docking services provided by the docking framework.
The 'EnableDocking' (
NOTE: The layout initialization code shown here is required only when docking window is being used programmatically. When using the designer, the layout state will automatically be written to the application's resource file.
private void InitializeDockingWindows()
{
// Create the DockingManager instance and set this form as the host form.
this.dockingManager = new Syncfusion.Windows.Forms.Tools.DockingManager(this.components);
this.dockingManager.BeginInit();
this.dockingManager.HostForm = this;
// Disable state persistence
this.dockingManager.PersistState = false;
// Enable display of the default context menus
this.dockingManager.EnableContextMenu = true;
// Set the imagelist that will provide the icons for the docking windows.
this.dockingManager.ImageList = this.ilDocking;
// Dock listbox1 to the left border of the form and with an initial
// width of 175 units.
// NOTE - Calling DockControl() on a control for the first time,
// will initialize it as a docking window. This is the equivalent of
// the DockingManager.SetEnableDocking() call.
this.dockingManager.DockControl(this.listBox1, this,
Syncfusion.Windows.Forms.Tools.Syncfusion.Windows.Forms.Tools.DockingStyle.Left, 175);
// Set the text to be displayed in the dockingwindow caption
this.dockingManager.SetDockLabel(this.listBox1, "ListBox 1");
// The image index used for this control
this.dockingManager.SetDockIcon(this.listBox1, 0);
// Now dock listbox2 as a tab onto listbox1
this.dockingManager.DockControl(this.listBox2, this.listBox1,
Syncfusion.Windows.Forms.Tools.Syncfusion.Windows.Forms.Tools.DockingStyle.Tabbed, 175);
this.dockingManager.SetDockLabel(this.listBox2, "ListBox 2");
this.dockingManager.SetDockIcon(this.listBox2, 1);
// Dock the treeView to the right border of the form with a width of 150.
this.dockingManager.DockControl(this.treeView1, this, Syncfusion.Windows.Forms.Tools.DockingStyle.Right, 150);
// Set treeView1 to start off in the AutoHide position.
this.dockingManager.SetAutoHideMode(this.treeView1, true);
this.dockingManager.SetDockLabel(this.treeView1, "TreeView");
this.dockingManager.SetDockIcon(this.treeView1, 2);
// Set checkedListBox1 to be initially in a floating position.
Rectangle rcfrm = this.Bounds;
this.dockingManager.FloatControl(this.checkedListBox1,
new Rectangle(rcfrm.Right+25,rcfrm.Bottom-250,175,300));
this.dockingManager.SetDockLabel(this.checkedListBox1, "Checked ListBox");
this.dockingManager.SetDockIcon(this.checkedListBox1, 3);
this.dockingManager.EndInit();
}
Private Sub InitializeDockingWindows()
' Create the DockingManager instance and set this form as the host form.
Me.dockingManager = New Syncfusion.Windows.Forms.Tools.DockingManager(Me.components)
Me.dockingManager.BeginInit()
Me.dockingManager.HostForm = Me
' Disable state persistence
Me.dockingManager.PersistState = False
' Enable display of the default context menus
Me.dockingManager.EnableContextMenu = True
' Set the imagelist that will provide the icons for the docking windows.
Me.dockingManager.ImageList = Me.ilDocking
' Dock listbox1 to the left border of the form and with an initial
' width of 175 units.
' NOTE - Calling DockControl() on a control for the first time,
' will initialize it as a docking window. This is the equivalent of
' the DockingManager.SetEnableDocking() call.
Me.dockingManager.DockControl(Me.listBox1, Me, Syncfusion.Windows.Forms.Tools.Syncfusion.Windows.Forms.Tools.DockingStyle.Left, 175)
' Set the text to be displayed in the dockingwindow caption
Me.dockingManager.SetDockLabel(Me.listBox1, "ListBox 1")
' The image index used for this control
Me.dockingManager.SetDockIcon(Me.listBox1, 0)
' Now dock listbox2 as a tab onto listbox1
Me.dockingManager.DockControl(Me.listBox2, Me.listBox1, Syncfusion.Windows.Forms.Tools.Syncfusion.Windows.Forms.Tools.DockingStyle.Tabbed, 175)
Me.dockingManager.SetDockLabel(Me.listBox2, "ListBox 2")
Me.dockingManager.SetDockIcon(Me.listBox2, 1)
' Dock the treeView to the right border of the form with a width of 150.
Me.dockingManager.DockControl(Me.treeView1, Me, Syncfusion.Windows.Forms.Tools.DockingStyle.Right, 150)
' Set treeView1 to start off in the AutoHide position.
Me.dockingManager.SetAutoHideMode(Me.treeView1, True)
Me.dockingManager.SetDockLabel(Me.treeView1, "TreeView")
Me.dockingManager.SetDockIcon(Me.treeView1, 2)
' Set checkedListBox1 to be initially in a floating position.
Dim rcfrm As Rectangle
rcfrm = Me.Bounds
Me.dockingManager.FloatControl(Me.checkedListBox1, New Rectangle((rcfrm.Right + 25), (rcfrm.Bottom - 250), 175, 300))
Me.dockingManager.SetDockLabel(Me.checkedListBox1, "Checked ListBox")
Me.dockingManager.SetDockIcon(Me.checkedListBox1, 3)
Me.dockingManager.EndInit()
End Sub
private void dockingManager1_AutoHideAnimationStart(object sender, Syncfusion.Windows.Forms.Tools.AutoHideAnimationEventArgs arg)
{
if (arg.DockBorder == DockStyle.Left || arg.DockBorder == DockStyle.Right)
Syncfusion.Windows.Forms.Tools.DockingManager.AnimationStep = arg.Bounds.Width;
else
Syncfusion.Windows.Forms.Tools.DockingManager.AnimationStep = arg.Bounds.Height;
}
Private Sub DockingManager1_AutoHideAnimationStart(ByVal sender As System.Object, ByVal arg As Syncfusion.Windows.Forms.Tools.AutoHideAnimationEventArgs) Handles DockingManager1.AutoHideAnimationStart
If (arg.DockBorder = DockStyle.Left Or arg.DockBorder = DockStyle.Right) Then
Syncfusion.Windows.Forms.Tools.DockingManager.AnimationStep = arg.Bounds.Width
Else
Syncfusion.Windows.Forms.Tools.DockingManager.AnimationStep = arg.Bounds.Height
End If
End Sub
dockingManager1.LockHostFormUpdate();
dockingManager1.LoadDockState();
dockingManager1.UnlockHostFormUpdate();
DockingManager1.LockHostFormUpdate()
DockingManager1.LoadDockState()
DockingManager1.UnlockHostFormUpdate()
//Loading DockState from IsolatedStorage
AppStateSErializer appstser=new AppStateSerializer(SerializeMode.IsolatedStorage, null);
dockingManager1.LoadDockState(appstser);
//Loading DockState from xml file(DockState.xml located in Application folder)
AppStateSerializer appstser =new AppStateSerializer(SerializeMode.XMLFile, "DockState");
dockingManager1.LoadDockState(appstser);
'Loading DockState from IsolatedStorage
Dim appstser As New AppStateSerializer(SerializeMode.IsolatedStorage, Nothing)
dockingManager1.LoadDockState(appstser)
'Loading DockState from xml file(DockState.xml located in Application folder)
Dim appstser As New AppStateSerializer(SerializeMode.XMLFile, "DockState")
dockingManager1.LoadDockState(appstser)
//Saving DockState to IsolatedStorage
AppStateSErializer appstser=new AppStateSerializer(SerializeMode.IsolatedStorage, null);
dockingManager1.SaveDockState(appstser);
appstser.PersistNow();
//Saving DockState to xml file(DockState.xml located in Application folder)
AppStateSerializer appstser =new AppStateSerializer(SerializeMode.XMLFile, "DockState");
dockingManager1.SaveDockState(appstser);
appstser.PersistNow();
'Saving DockState to IsolatedStorage
Dim appstser As New AppStateSerializer(SerializeMode.IsolatedStorage, Nothing)
dockingManager1.SaveDockState(appstser)
appstser.PersistNow()
'Saving DockState to xml file(DockState.xml located in Application folder)
Dim appstser As New AppStateSerializer(SerializeMode.XMLFile, "DockState")
dockingManager1.SaveDockState(appstser)
appstser.PersistNow()
//Float control panel1 in specified manner.
dockingManager1.FloatControl(panel1,new Rectangle(1,1,200,200));
'Float control panel1 in specified manner.
DockingManager1.FloatControl(Panel1,new Rectangle(1,1,200,200))
//Float control panel1 in specified manner.
dockingManager1.FloatControl(panel1,new Rectangle(1,1,200,200),true);
'Float control panel1 in specified manner.
DockingManager1.FloatControl(Panel1,new Rectangle(1,1,200,200),true)
//Add the document container to the hostform of the
dockingManager1.UseDocumentContainer= true;
//Dock the panel1 in document state.
dockingManager1.DockAsDocument(panel1));
'Add the document container to the hostform of the
DockingManager1.UseDocumentContainer= true
'Dock the panel1 in document state.
DockingManager1.dockingManager1.DockAsDocument(panel1))
//Add the document container to the hostform of the
dockingManager1.EnableDocumentMode= true;
//Dock the panel1 in document state.
dockingManager1.FreezeToDocumentState(panel1, true);
'Add the document container to the hostform of the
DockingManager1.EnableDocumentMode= true
'Dock the panel1 in document state.
DockingManager1.dockingManager1.FreezeToDocumentState(panel1, true))
//Code to dock a control to left of HostForm with width 100
dockingManager1.DockControl(panel1,this,Syncfusion.Windows.Forms.Tools.DockingStyle.Left,100);
//Code to dock a control(panel1) to top of another docked control(panel2).
dockingManager1.DockControl(panel1,panel2,Syncfusion.Windows.Forms.Tools.DockingStyle.Top,100);//panel1 will take space from panel2 at the top
//Code to dock a control(panel1) into another docked control(panel2) in tabbed style
dockingManager1.DockControl(panel1,panel2,Syncfusion.Windows.Forms.Tools.DockingStyle.Tabbed,100);
//Code to Dock a control(panel1) into another docked control(panel2) in tabbed style with whole tab group
dockingManager1.DockControl(panel1,panel2,DockingStyle.Tabbed,150,false);
'Code to dock a control to left side of HostForm with width 100
DockingManager1.DockControl(Panel1,this,Syncfusion.Windows.Forms.Tools.DockingStyle.Left,100);
'Code to dock a control(Panel1) to top of another docked control(Panel2).
DockingManager1.DockControl(panel1,panel2,Syncfusion.Windows.Forms.Tools.DockingStyle.Top,100);//Panel1 will take space from Panel2 at the top
'Code to dock a control(Panel1) into another docked control(Panel2) in tabbed style
DockingManager1.DockControl(Panel1,Panel2,Syncfusion.Windows.Forms.Tools.DockingStyle.Tabbed,100);
'Code to Dock a control(Panel1) into another docked control(Panel2) in tabbed style with whole tab group
DockingManager1.DockControl(Panel1,Panel2,DockingStyle.Tabbed,150,false);
private void dockingManager1_DragAllow(object sender, Syncfusion.Windows.Forms.Tools.DragAllowEventArgs arg){
//Check the control which is going to be dragged and cancel according to that
if(arg.Control==panel1)
arg.Cancel=true;
}
Private Sub dockingManager1_DragAllow(ByVal sender As Object, ByVal arg As Syncfusion.Windows.Forms.Tools.DragAllowEventArgs) Handles dockingManager1.DragAllow
'Check the control which is going to be dragged and cancel according to that
If(arg.Control==panel1)Then
arg.Cancel=true;
EndIf
End Sub
private void dockingManager1_DockVisibilityChanging(object sender, Syncfusion.Windows.Forms.Tools.DockVisibilityChangingEventArgs arg){
//Check the control and cancel closing.
if (arg.Control == panel1)
arg.Cancel = true;
}
Private Sub dockingManager1_DockVisibilityChanging(ByVal sender As Object, ByVal arg As Syncfusion.Windows.Forms.Tools.DockContextMenuEventArgs) Handles dockingManager1.DockVisibilityChanging
'Check the control and cancel closing.
if (arg.Control == Panel1) Then
arg.Cancel = true;
End If
End Sub
private void dockingManager1_AutoHideAnimationStart(object sender, Syncfusion.Windows.Forms.Tools.AutoHideAnimationEventArgs arg)
{
if (arg.DockBorder == DockStyle.Left || arg.DockBorder == DockStyle.Right)
Syncfusion.Windows.Forms.Tools.DockingManager.AnimationStep = arg.Bounds.Width;
else
Syncfusion.Windows.Forms.Tools.DockingManager.AnimationStep = arg.Bounds.Height;
}
Private Sub DockingManager1_AutoHideAnimationStart(ByVal sender As System.Object, ByVal arg As Syncfusion.Windows.Forms.Tools.AutoHideAnimationEventArgs) Handles DockingManager1.AutoHideAnimationStart
If (arg.DockBorder = DockStyle.Left Or arg.DockBorder = DockStyle.Right) Then
Syncfusion.Windows.Forms.Tools.DockingManager.AnimationStep = arg.Bounds.Width
Else
Syncfusion.Windows.Forms.Tools.DockingManager.AnimationStep = arg.Bounds.Height
End If
End Sub
private void docMgr_DockContextMenu(object sender, Syncfusion.Windows.Forms.Tools.DockContextMenuEventArgs arg){
//Checking the control and assigning an empty menu
if (arg.Owner == panel1)
arg.ContextMenu = new Syncfusion.Windows.Forms.Tools.XPMenus.PopupMenu();
}
Private Sub dockingManager1_DockContextMenu(ByVal sender As Object, ByVal arg As Syncfusion.Windows.Forms.Tools.DockContextMenuEventArgs) Handles dockingManager1.DockContextMenu
'Checking the control and assigning an empty menu
If (arg.Owner == panel1) Then
arg.ContextMenu = new Syncfusion.Windows.Forms.Tools.XPMenus.PopupMenu()
End If
End Sub
private void dockingManager1_NewDockStateEndLoad(object sender, EventArgs e)
{
DockStateLoadEventArgs dsle = (DockStateLoadEventArgs)e;
Console.WriteLine(dsle.LoadResult.ToString());
}
Private Sub DockingManager_NewDockStateEndLoad(ByVal sender As Object, ByVal e As System.EventArgs) Handles DockingManager.NewDockStateEndLoad
Dim dsle As DockStateLoadEventArgs = CType(e, DockStateLoadEventArgs)
Console.WriteLine(dsle.LoadResult)
End Sub
void dockingManager1_ProvideGraphicsItems(object sender, Syncfusion.Windows.Forms.Tools.ProvideGraphicsItemsEventArgs arg)
{
if (arg.Control == panel1) //Checks if the control is panel1
{
if (arg.IsActiveCaption)//Different drawing for active and inactive states
{
arg.CaptionBackground = Brushes.Blue;
arg.CaptionFont = new Font("Times New Roman", 10);
arg.CaptionForeground = Color.White;
}
else{
arg.CaptionBackground = Brushes.Gray;
arg.CaptionFont = new Font("Times New Roman", 10);
arg.CaptionForeground = Color.White;
}
}
}
Private Sub DockingManager1_ProvideGraphicsItems(ByVal sender As System.Object, ByVal arg As Syncfusion.Windows.Forms.Tools.ProvideGraphicsItemsEventArgs) Handles DockingManager1.ProvideGraphicsItems
If arg.Control Is Panel1 Then ' Checks if the control is panel1
If arg.IsActiveCaption then 'Different drawing for active and inactive states
arg.CaptionBackground = Brushes.Blue
arg.CaptionFont = New Font("Times New Roman", 10)
arg.CaptionForeground = Color.White
Else
arg.CaptionBackground = Brushes.Gray
arg.CaptionFont = New Font("Times New Roman", 10)
arg.CaptionForeground = Color.White
End If
End If
End Sub
private void DockingManager1_TabGroupCreating(object sender, Syncfusion.Windows.Forms.Tools.TabGroupCreatingEventArgs arg){
//Check the TargetItem and cancel creating document tab group.
if (arg.TargetItem == panel1)
arg.Cancel = true;
//Check the Orientation and cancel creating document tab group.
if (arg.Orientation== Orientation.Horizontal)
arg.Cancel = true;
}
Private Sub DockingManager1_TabGroupCreating(ByVal sender As Object, ByVal arg As Syncfusion.Windows.Forms.Tools.TabGroupCreatingEventArgs) Handles dockingManager1.DockVisibilityChanging
'Check the control and cancel creating document tab group
if (arg.TargetItem == Panel1) Then
arg.Cancel = true
'Check the Orientation and cancel creating document tab group.
if (arg.Orientation== Orientation.Horizontal) Then
arg.Cancel = true
End If
End Sub
dockingManager1.BrowsingKey = Keys.F10;
dockingManager1.BrowsingKey=((System.Windows.Forms.Keys)(Enum.Parse(typeof(Keys), "F12, Shift, Control"))); //This will set Ctrl+Shift+F12 as browsing key
DockingManager1.BrowsingKey = Keys.F10
Me.DockingManager1.BrowsingKey = CType(Enum.Parse(typeof(Keys), "F12, Shift, Control"),System.Windows.Forms.Keys) 'This will set Ctrl+Shift+F12 as browsing key
IEnumerator ienum = this.dockingManager1.Controls;
ArrayList dockedctrls = new ArrayList();
while(ienum.MoveNext())
dockedctrls.Add(ienum.Current);
foreach(Control ctrl in dockedctrls)
Console.WriteLine(ctrl.ToString());
Dim ienum As IEnumerator = Me.dockingManager1.Controls
Dim dockedctrls As ArrayList = New ArrayList()
Do While ienum.MoveNext()
dockedctrls.Add(ienum.Current)
Loop
Dim ctrl As Control
For Each ctrl In dockedctrls
Console.WriteLine(ctrl.ToString())
Next
The DockToFill option should not be set when the host form is an MDIContainer or if it contains an instance of the
NOTE: This property applies only when the DockingManager is hosted, either directly or indirectly through a ContainerControl, in an MDI child form.
NOTE: This property applies only when the DockingManager is hosted in a ContainerControl.
this.tabbedMDIManager = new TabbedMDIManager();
this.tabbedMDIManager.AttachToMdiContainer(this);
Me.tabbedMDIManager = New TabbedMDIManager()
Me.tabbedMDIManager.AttachToMdiContainer(Me)
// Append menus to the standard mdi tab context menu
ParentBarItem contextMenuItem = new ParentBarItem();
BarItem newDocItem = new BarItem();
newDocItem.Click += new System.EventHandler(this.addDoc1_Click);
newDocItem.Text = "Custom Item: Insert New Doc";
newDocItem.MergeOrder = 30;
contextMenuItem.Items.Add(newDocItem);
BarItem exitItem = new BarItem();
exitItem.Click += new System.EventHandler(this.FileExit_Clicked);
exitItem.Text = "CustomItem: Exit";
exitItem.MergeOrder = 30;
contextMenuItem.Items.Add(exitItem);
contextMenuItem.BeginGroupAt(newDocItem);
// Items in this ParentBarItem will be merged with the standard context menu ParentBarItem of the mdi tab.
tabbedMDIManager.ContextMenuItem = contextMenuItem;
' Append menus to the standard mdi tab context menu
Dim contextMenuItem As ParentBarItem
contextMenuItem = New ParentBarItem()
Dim newDocItem As BarItem
newDocItem = New BarItem()
AddHandler newDocItem.Click, New System.EventHandler(AddressOf addDoc1_Click)
newDocItem.Text = "Custom Item: Insert New Doc"
newDocItem.MergeOrder = 30
contextMenuItem.Items.Add(newDocItem)
Dim exitItem As BarItem
exitItem = New BarItem()
AddHandler exitItem.Click, New System.EventHandler(AddressOf FileExit_Clicked)
exitItem.Text = "CustomItem: Exit"
exitItem.MergeOrder = 30
contextMenuItem.Items.Add(exitItem)
contextMenuItem.BeginGroupAt(newDocItem)
' Items in this ParentBarItem will be merged with the standard context menu ParentBarItem of the mdi tab.
tabbedMDIManager.ContextMenuItem = contextMenuItem
foreach(Form form in this.tabbedMDIManager.MdiChildren)
{
children += form.Text + "\r\n";
}
Dim form As Form
For Each form In Me.tabbedMDIManager.MdiChildren
' Process form
Next
public MainForm() {
//
// Required for Windows Form Designer support
//
InitializeComponent();
tabbedMDIManager = new TabbedMDIManager();
//tabbedMDIManager.UseIconsInTabs = false;
//Add Window Menu
this.miWindow = mainMenu.MenuItems.Add("Window");
miWindow.MergeOrder = 10;
miWindow.MenuItems.Add("Cascade", new System.EventHandler(this.WindowCascade_Clicked));
miWindow.MenuItems.Add("Tile Horizontal", new System.EventHandler(this.WindowTileH_Clicked));
miWindow.MenuItems.Add("Tile Vertical", new System.EventHandler(this.WindowTileV_Clicked));
miWindow.MenuItems.Add("MDI Tabbed", new System.EventHandler(this.TabbedWindows_Clicked));
// Let the TabbedMDIManager insert the Mdi Child windows list
this.tabbedMDIManager.MdiListMenuItem = miWindow;
// Append menus to the standard mdi tab context menu
ParentBarItem contextMenuItem = new ParentBarItem();
BarItem newDocItem = new BarItem();
newDocItem.Click += new System.EventHandler(this.addDoc1_Click);
newDocItem.Text = "Custom Item: Insert New Doc";
newDocItem.MergeOrder = 30;
contextMenuItem.Items.Add(newDocItem);
BarItem exitItem = new BarItem();
exitItem.Click += new System.EventHandler(this.FileExit_Clicked);
exitItem.Text = "CustomItem: Exit";
exitItem.MergeOrder = 30;
contextMenuItem.Items.Add(exitItem);
contextMenuItem.BeginGroupAt(newDocItem);
// Items in this ParentBarItem will be merged with the standard context menu ParentBarItem of the mdi tab.
tabbedMDIManager.ContextMenuItem = contextMenuItem;
}
// Convenient way to toggle TabbedMDI mode.
private bool TabbedMDIOn
{
get { return this.tabWindowsOn; }
set
{
if(!(this.tabWindowsOn == value))
{
this.tabWindowsOn = value;
if(this.tabWindowsOn)
{
this.tabbedMDIManager.AttachToMdiContainer(this);
}
else
{
this.tabbedMDIManager.DetachFromMdiContainer(this, false); // false to not invoke the Cascade mode after detaching.
}
}
}
}
//Add a document
private void AddDocument(Form doc) {
doc.MdiParent = this;
doc.Show();
}
private void MainForm_Load(object sender, System.EventArgs e)
{
// Add 4 documents
this.addDoc1_Click(this, EventArgs.Empty);
this.addDoc1_Click(this, EventArgs.Empty);
this.addDoc1_Click(this, EventArgs.Empty);
this.addDoc1_Click(this, EventArgs.Empty);
// Turn on MDI Tabbed Documents mode.
// Call this after loading the mdi children to restore their previous state.
this.TabbedMDIOn = true;
}
private int document1Count = 0 ;
private void addDoc1_Click(object sender, System.EventArgs e)
{
document1Count++ ;
Document1 doc = new Document1("DocumentOne " + document1Count.ToString());
AddDocument(doc);
}
//Window->Cascade Menu item handler
protected void WindowCascade_Clicked(object sender, System.EventArgs e) {
this.TabbedMDIOn = false;
this.LayoutMdi(MdiLayout.Cascade);
}
Public Sub New()
MyBase.New()
'
' Required for Windows Form Designer support
'
InitializeComponent()
tabbedMDIManager = New TabbedMDIManager()
'tabbedMDIManager.UseIconsInTabs = false;
'Add Window Menu
Me.miWindow = mainMenu.MenuItems.Add("Window")
miWindow.MergeOrder = 10
miWindow.MenuItems.Add("Cascade", New System.EventHandler(AddressOf WindowCascade_Clicked))
miWindow.MenuItems.Add("Tile Horizontal", New System.EventHandler(AddressOf WindowTileH_Clicked))
miWindow.MenuItems.Add("Tile Vertical", New System.EventHandler(AddressOf WindowTileV_Clicked))
miWindow.MenuItems.Add("MDI Tabbed", New System.EventHandler(AddressOf TabbedWindows_Clicked))
' Let the TabbedMDIManager insert the Mdi Child windows list
Me.tabbedMDIManager.MdiListMenuItem = miWindow
' Append menus to the standard mdi tab context menu
Dim contextMenuItem As ParentBarItem
contextMenuItem = New ParentBarItem()
Dim newDocItem As BarItem
newDocItem = New BarItem()
AddHandler newDocItem.Click, New System.EventHandler(AddressOf addDoc1_Click)
newDocItem.Text = "Custom Item: Insert New Doc"
newDocItem.MergeOrder = 30
contextMenuItem.Items.Add(newDocItem)
Dim exitItem As BarItem
exitItem = New BarItem()
AddHandler exitItem.Click, New System.EventHandler(AddressOf FileExit_Clicked)
exitItem.Text = "CustomItem: Exit"
exitItem.MergeOrder = 30
contextMenuItem.Items.Add(exitItem)
contextMenuItem.BeginGroupAt(newDocItem)
' Items in this ParentBarItem will be merged with the standard context menu ParentBarItem of the mdi tab.
tabbedMDIManager.ContextMenuItem = contextMenuItem
End Sub
' Convenient way to toggle TabbedMDI mode.
Property TabbedMDIOn() As Boolean
Get
Return Me.tabWindowsOn
End Get
Set(ByVal Value As Boolean)
If (Not (Me.tabWindowsOn = Value)) Then
Me.tabWindowsOn = Value
If Me.tabWindowsOn Then
Me.tabbedMDIManager.AttachToMdiContainer(Me)
Else
Me.tabbedMDIManager.DetachFromMdiContainer(Me, False)
End If
End If
End Set
End Property
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
MyBase.Dispose(disposing)
If (Not (components) Is Nothing) Then
components.Dispose()
End If
End Sub
Private Sub AddDocument(ByVal doc As Form)
doc.MdiParent = Me
doc.Show()
End Sub
Private Sub MainForm_Load(ByVal sender As Object, ByVal e As EventArgs)
' Add 4 documents
Me.addDoc1_Click(Me, EventArgs.Empty)
Me.addDoc1_Click(Me, EventArgs.Empty)
Me.addDoc1_Click(Me, EventArgs.Empty)
Me.addDoc1_Click(Me, EventArgs.Empty)
' Turn on MDI Tabbed Documents mode.
' Call this after loading the mdi children to restore their previous state.
Me.TabbedMDIOn = True
End Sub
Private Sub addDoc1_Click(ByVal sender As Object, ByVal e As EventArgs)
document1Count = (document1Count + 1)
Dim doc As Document1
doc = New Document1(("DocumentOne " + document1Count.ToString))
AddDocument(doc)
End Sub
' Window->Cascade Menu item handler
Protected Sub WindowCascade_Clicked(ByVal sender As Object, ByVal e As EventArgs)
Me.TabbedMDIOn = False
Me.LayoutMdi(MdiLayout.Cascade)
End Sub
public void InitMyFileMenu()
{
// Set the MergeType to Add so that the bar item is added to the
// merged menu/bar.
barItem1.MergeType = MenuMerge.Add;
// Set the MergeOrder to 1 so that this bar item is placed lower
// in the merged menu/bar order.
barItem1.MergeOrder = 1;
}
public void Popup(Object sender, EventArgs e)
{
// Determine if there is text selected in textBox1.
if(textBox1.SelectedText == "")
{
// Disable the menus since no text is selected in textBox1.
menuItemCut.Enabled = false;
menuItemCopy.Enabled = false;
menuItemDelete.Enabled = false;
}
else
{
// Text is selected in textBox1, so enable menu items.
menuItemCut.Enabled = true;
menuItemCopy.Enabled = true;
menuItemDelete.Enabled = true;
}
}
// The following event handler would be connected to three menu items.
private void MyMenuClick(Object sender, EventArgs e)
{
// Determine if clicked menu item is the Blue bar item.
if(sender == menuItemBlue)
{
// Set the checkmark for the menuItemBlue bar item.
menuItemBlue.Checked = true;
// Uncheck the menuItemRed and menuItemGreen bar items.
menuItemRed.Checked = false;
menuItemGreen.Checked = false;
// Set the color of the text in the TextBox control to Blue.
textBox1.ForeColor = Color.Blue;
}
else if(sender == menuItemRed)
{
// Set the checkmark for the menuItemRed bar item.
menuItemRed.Checked = true;
// Uncheck the menuItemBlue and menuItemGreen bar items.
menuItemBlue.Checked = false;
menuItemGreen.Checked = false;
// Set the color of the text in the TextBox control to Red.
textBox1.ForeColor = Color.Red;
}
else
{
// Set the checkmark for the menuItemGreen.
menuItemGreen.Checked = true;
// Uncheck the menuItemRed and menuItemBlue bar items.
menuItemBlue.Checked = false;
menuItemRed.Checked = false;
// Set the color of the text in the TextBox control to Blue.
textBox1.ForeColor = Color.Green;
}
}
public void SetupMyMenuItem()
{
// Set the caption for the bar item.
barItem1.Text = "New";
// Assign a shortcut key.
barItem1.Shortcut = Shortcut.CtrlN;
// Make the bar item visible.
barItem1.Visible = true;
}
public void SetupMyMenuItem()
{
// Set the caption for the bar item.
barItem1.Text = "New";
// Assign a shortcut key.
barItem1.Shortcut = Shortcut.CtrlN;
// Make the bar item visible.
barItem1.Visible = true;
}
Public Sub SetupMyMenuItem()
' Set the caption for the bar item.
barItem1.Text = "New"
' Assign a shortcut key.
barItem1.Shortcut = Shortcut.CtrlN
' Make the bar item visible.
barItem1.Visible = True
End Sub 'SetupMyMenuItem
public void SetupMyMenuItem()
{
// Set the caption for the menu item.
menuItem1.Text = "New";
// Assign a shortcut key.
menuItem1.Shortcut = Shortcut.CtrlN;
// Make the menu item visible.
menuItem1.Visible = true;
}
Public Sub SetupMyMenuItem()
' Set the caption for the menu item.
menuItem1.Text = "New"
' Assign a shortcut key.
menuItem1.Shortcut = Shortcut.CtrlN
' Make the menu item visible.
menuItem1.Visible = True
End Sub 'SetupMyMenuItem
To reset this property programmatically, specify null. In design time select "Reset" from the context menu of the property grid entry of this property.
This property is useful when you want to replace the default shortcut text (for example, "Ctrl+D0", displayed when Shortcut.Ctrl0 is the shortcut), with something else (say "Ctrl0", in the above example).
The Essential Tools CommandBars framework implements a hosting environment that can be used for creating toolbars, statusbars and rebars similar to those that are present in the Microsoft Visual Studio.NET IDE and the Microsoft Office XP product suite. A CommandBar, similar to Win32/MFC control bars, is purely a container control that is responsible only for it's layout state and it is the client window, such as a ToolBar, StatusBar or any other Windows Forms control, that provides the CommandBar with it's functional identity.
CommandBars have two basic states - a docked state and a floating state. In the docked state, the CommandBars are usually aligned along one of the borders (left, right, top or bottom) of the host form. Depending upon the preferences set, the bar can either take up an entire row as in the case of a menu or share it's space with other bars within a particular row as with toolbars and rebars. By default, a docked CommandBar has a gripper and a drop-down button with a customizable click event. The gripper can be used to reposition the bar within a row, move it between rows and to drag it out of the frame and float as a separate window. In the docked mode, when the row width is adequate, the CommandBars are usually sized to their maximum length. However, reducing the frame width/height will, based on the user-setting, force the CommandBar to reduce in size while retaining the same height or wrap thereby increasing the bar height. The wrapping mode is particularly useful for toolbars and is fully customizable. In the floating state, the CommandBar is parented by a floating window that can dragged around the desktop. A floating CommandBar can be redocked to it's host by either double-clicking it or by dragging it over one of the edges of the host form.
The CommandBarController class, as the name implies, serves as a form-scope controller for all the CommandBars.
Attributes that are common across all CommandBars within a host form, such as the
private void InitializeCommandBars()
{
// Create the CommandBarController
this.commandBarController1 = new Syncfusion.Windows.Forms.Tools.CommandBarController();
((System.ComponentModel.ISupportInitialize)(this.commandBarController1)).BeginInit();
// Set the CommandBarController's host form
this.commandBarController1.HostForm = this;
this.commandBarController1.PersistState = true;
// Create the CommandBar control
this.commandBarAddress = new Syncfusion.Windows.Forms.Tools.CommandBar();
// Set the CommandBar Layout/Behavior/Appearance attributes
this.commandBarAddress.DockBorder = Syncfusion.Windows.Forms.Tools.DockBorder.Top;
this.commandBarAddress.HideDropDownButton = true;
this.commandBarAddress.MaxLength = 400;
this.commandBarAddress.MinHeight = 26;
this.commandBarAddress.MinLength = 50;
this.commandBarAddress.Name = "commandBarAddress";
this.commandBarAddress.RowIndex = 1;
this.commandBarAddress.RowOffset = 1;
this.commandBarAddress.Text = "Address";
// Create the ComboBox control and add it to the CommandBars Controls collection
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.commandBarAddress.Controls.AddRange(new System.Windows.Forms.Control[] {this.comboBox1});
// Add the CommandBar to the CommandBarController.CommandBars collection
this.commandBarController1.CommandBars.Add(this.commandBarAddress);
((System.ComponentModel.ISupportInitialize)(this.commandBarController1)).EndInit();
}
Private Sub InitializeCommandBars()
' Create the CommandBarController
Me.commandBarController1 = New Syncfusion.Windows.Forms.Tools.CommandBarController(Me.components)
CType(Me.commandBarController1, System.ComponentModel.ISupportInitialize).BeginInit()
' Set the CommandBarController's host form
Me.commandBarController1.HostForm = Me
Me.commandBarController1.PersistState = True
' Create the CommandBar control
Me.commandBarAddress = New Syncfusion.Windows.Forms.Tools.CommandBar()
' Set the CommandBar Layout/Behavior/Appearance attributes
Me.commandBarAddress.DockState = Syncfusion.Windows.Forms.Tools.CommandBarDockState.Top
Me.commandBarAddress.MaxLength = 400
Me.commandBarAddress.MinHeight = 26
Me.commandBarAddress.MinLength = 50
Me.commandBarAddress.Name = "commandBarAddress"
Me.commandBarAddress.RowIndex = 1
Me.commandBarAddress.RowOffset = 1
Me.commandBarAddress.Text = "Address"
' Create the ComboBox control and add it to the CommandBars Controls collection
Me.comboBox1 = New System.Windows.Forms.ComboBox()
Me.commandBarAddress.Controls.AddRange(New System.Windows.Forms.Control() {Me.comboBox1})
' Add the CommandBar to the CommandBarControllers CommandBars // collection
Me.commandBarController1.CommandBars.Add(Me.commandBarAddress)
CType(Me.commandBarController1, System.ComponentModel.ISupportInitialize).EndInit()
End Sub
// Listen to the AfterClone event of the ChildFrameBarManager and
// set the cloned BarManager's ImageList and LargeImageList.
// This is necessary because cloning an ImageList (il1.ImageStream = il2.ImageStream;) seems to be broken in 1.1.
private void childFrameBarManager_AfterClone(object sender, Syncfusion.Windows.Forms.Tools.XPMenus.BarManagerClonedEventArgs args)
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(this.GetType());
// Load the images from the resource and set it to the ImageLists.
// You can typically copy the right-hand side portion of the following statements from the
// designer generated code in the InitializeComponent method.
// imgList16 and imgList24 are the names of the ImageList instances in this Form.
args.ClonedBarManager.ImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgList16.ImageStream")));
args.ClonedBarManager.LargeImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgList24.ImageStream")));
}
' Listen to the AfterClone event of the ChildFrameBarManager and
' set the cloned BarManager's ImageList and LargeImageList.
' This is necessary because cloning an ImageList (il1.ImageStream = il2.ImageStream;) seems to be broken in 1.1.
Private Sub childFrameBarManager_AfterClone(ByVal sender As Object, ByVal args As Syncfusion.Windows.Forms.Tools.XPMenus.BarManagerClonedEventArgs)
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(Me.GetType())
' Load the images from the resource and set it to the ImageLists.
' You can typically copy the right-hand side portion of the following statements from the
' designer generated code in the InitializeComponent method.
args.ClonedBarManager.ImageList.ImageStream = (CType((resources.GetObject("imgList16.ImageStream")), System.Windows.Forms.ImageListStreamer))
args.ClonedBarManager.LargeImageList.ImageStream = (CType((resources.GetObject("imgList24.ImageStream")), System.Windows.Forms.ImageListStreamer))
End Sub
This is usually called for a
This event is provided to workaround a 1.1 framework bug which prevents us from cloning an ImageList (The code "imageList.ImageStream = anotherImageList.ImageStream" doesn't work in 1.1).
In code, you can initialize an XPToolBar as follows:
XPToolBar xpToolBar1;
// Create a new tool bar control.
XPToolBar xptoolbar2 = new XPToolBar();
// Add some one or more instances of BarItem to it.
xptoolbar2.Items.AddRange(new BarItem[]{this.barItem1, this.barItem2, this.barItem3});
// Setup a separator.
xptoolbar2.BeginGroupAt(this.barItem2);
// Set its position and add it to the Form.
xptoolbar2.Dock = DockStyle.Top;
xptoolbar2.Size = new Size(200, 30);
this.Controls.Add(xptoolbar2);
Dim xpToolBar1 As XPToolBar
' Create a new tool bar control.
Dim xptoolbar2 As New XPToolBar()
' Add some one or more instances of BarItem to it.
xptoolbar2.Items.AddRange(New BarItem() {Me.barItem1, Me.barItem2, Me.barItem3})
' Setup a separator.
xptoolbar2.BeginGroupAt(Me.barItem2)
' Set its position and add it to the Form.
xptoolbar2.Dock = DockStyle.Top
xptoolbar2.Size = New Size(200, 30)
Me.Controls.Add(xptoolbar2)
private void Form_Load(object sender, System.EventArgs e)
{
this.barControl1.Items.Add(this.barItem1);
this.barControl1.Items.Add(this.barItem2);
this.barControl1.Items.Add(this.parentBarItem1);
}
using Syncfusion.Windows.Forms.Tools;
using System.Windows.Forms;
namespace WFApplication1
{
public partial class Form1 : Form
{
ComboBoxAutoComplete comboBoxAutoComplete1 = new ComboBoxAutoComplete();
public Form1()
{
InitializeComponent();
this.comboBoxAutoComplete1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
this.comboBoxAutoComplete1.AutoCompleteCustomSource.AddRange(new string[] { "Custom", "Customizing", "Customizable" });
this.comboBoxAutoComplete1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
this.comboBoxAutoComplete1.AutoCompleteSource = AutoCompleteSource.CustomSource;
this.Controls.Add(comboBoxAutoComplete1);
}
}
}
This property will be ignored by the
The
The TreeNodeAdv label is set by setting the
You can specify images for the node using the
The order in which the tree node's contents are drawn is as follows:
The "State image" will be one of OpenImgIndex, ClosedImgIndex and NoChildrenImgIndex.
Selecting specific tree nodes and iterating through the
Tree nodes can be expanded to display the next level of child tree nodes.
The user can expand the tree node by pressing the plus (+) button next to the
TreeNodeAdv, if one is displayed or you can expand the TreeNodeAdv by calling the
The following example displays customer information in a
// Create a new ArrayList to hold the Customer objects.
private ArrayList customerArray = new ArrayList();
private void FillMyTreeView()
{
// Add customers to the ArrayList of Customer objects.
for(int x=0; x!=1000; x++)
{
customerArray.Add(new Customer("Customer" + x.ToString()));
}
// Add orders to each Customer object in the ArrayList.
foreach(Customer customer1 in customerArray)
{
for(int y=0; y!=15; y++)
{
customer1.CustomerOrders.Add(new Order("Order" + y.ToString()));
}
}
// Display a wait cursor while the TreeNodeAdvs are being created.
Cursor.Current = new Cursor("C:\\Cursors\\MyWait.cur");
// Clear the TreeViewAdv each time the method is called.
treeViewAdv1.Nodes.Clear();
// Add a root TreeNodeAdv for each Customer object in the ArrayList.
foreach(Customer customer2 in customerArray)
{
treeViewAdv1.Nodes.Add(new TreeNodeAdv(customer2.CustomerName));
// Add a child treenode for each Order object in the current Customer object.
foreach(Order order1 in customer2.CustomerOrders)
{
treeViewAdv1.Nodes[customerArray.IndexOf(customer2)].Nodes.Add(
new TreeNodeAdv(customer2.CustomerName + "." + order1.OrderID));
}
}
// Reset the cursor to the default for all controls.
Cursor.Current = Cursors.Default;
}
' Create a new ArrayList to hold the Customer objects.
Private customerArray As New ArrayList()
Private Sub FillMyTreeView()
' Add customers to the ArrayList of Customer objects.
Dim x As Integer
For x = 0 To 999
customerArray.Add(New Customer("Customer" + x.ToString()))
Next x
' Add orders to each Customer object in the ArrayList.
Dim customer1 As Customer
For Each customer1 In customerArray
Dim y As Integer
For y = 0 To 14
customer1.CustomerOrders.Add(New Order("Order" + y.ToString()))
Next y
Next customer1
' Display a wait cursor while the TreeNodeAdvs are being created.
Cursor.Current = New Cursor("C:\Cursors\MyWait.cur")
' Clear the TreeViewAdv each time the method is called.
treeViewAdv1.Nodes.Clear()
' Add a root TreeNodeAdv for each Customer object in the ArrayList.
Dim customer2 As Customer
For Each customer2 In customerArray
treeViewAdv1.Nodes.Add(New TreeNodeAdv(customer2.CustomerName))
' Add a child TreeNodeAdv for each Order object in the current Customer object.
Dim order1 As Order
For Each order1 In customer2.CustomerOrders
treeViewAdv1.Nodes(customerArray.IndexOf(customer2)).Nodes.Add( _
New TreeNodeAdv(customer2.CustomerName + "." + order1.OrderID))
Next order1
Next customer2
' Reset the cursor to the default for all controls.
Cursor.Current = System.Windows.Forms.Cursors.Default
' Begin repainting the TreeView.
treeViewAdv1.EndUpdate()
End Sub 'FillMyTreeView
You can also use the
Note that setting this property will fire the
treeNodeAdv.NodeStyle.CheckState = CheckState.Checked;
treeNodeAdv.NodeStyle.CheckState = CheckState.Checked
Any Object derived type may be assigned to this property. If this property is being set through the Windows Forms designer, only text may be assigned.
When the tree node is cloned, if this object is cloneable (implements ICloneable interface) then it will be.
You can also use the more flexible
The path consists of the labels of all of the tree nodes that must be
navigated to get to this tree node, starting at the root tree node. The node
labels are separated by the delimiter character specified in the
This collection contains references to all selected nodes in the TreeViewAdv.
Adding a
Whenever a node is selected/deselected, either by user action or in code, it is automatically added/removed from the SelectedNodes collection.
This collection is read-only, which means you can add and remove elements but cannot change the existing elements.
You can listen to new selections being added to this collection using the collection's
Use this class (will be referred to as "tracker" below) only when you want to support dropping adjacent (above or below) to a node.
Otherwise simply listen to the
The usage semantics for the tracker is as follows:
By default (when value is negative), the top 1/3 of the node will be considered the top edge.
This value will be used when you allow dropping before a node using
the
By default (when value is negative), the bottom 1/3 of the node will be considered the bottom edge.
This value will be used when you allow dropping below a node using the
Office2013ColorTable color = new Office2013ColorTable();
color.FileMenuForeColor = Color.Yellow;
this.ribbonControlAdv1.Office2013ColorTable = color;
Office2013ColorTable color = new Office2013ColorTable();
color.FileMenuHoverForeColor = Color.Yellow;
this.ribbonControlAdv1.Office2013ColorTable = color;
Office2016ColorTable color = new Office2016ColorTable();
color.FileMenuForeColor = Color.Yellow;
this.ribbonControlAdv1.Office2016ColorTable.Add(color);
Office2016ColorTable color = new Office2016ColorTable();
color.FileMenuHoverForeColor = Color.Yellow;
this.ribbonControlAdv1.Office2016ColorTable.Add(color);
public partial class Form1 : RibbonForm
{
public Form1()
{
InitializeComponent();
Button button = new Button();
button.Text = "Sign in";
this.HeaderItem = button;
}
}
private void splashControl1_SplashClosed(object sender, System.EventArgs e)
{
MessageBox.Show("The Splash screen has closed.");
}
Private Sub splashControl1_SplashClosed(ByVal sender As Object, ByVal e As System.EventArgs)
MessageBox.Show("The Splash screen has closed.")
End Sub
private void tabControlAdv1_SelectedIndexChanging(object sender, Syncfusion.Windows.Forms.Tools.SelectedIndexChangingEventArgs args)
{
TabPageAdv newPage = this.tabControlAdv1.TabPages[args.NewSelectedIndex];
if(newPage == this.tab1)
{
MessageBox.Show("Cannot select tab page 1");
args.Cancel = true;
}
}
Private Sub tabControlAdv1_SelectedIndexChanging(ByVal sender As Object, ByVal args As Syncfusion.Windows.Forms.Tools.SelectedIndexChangingEventArgs)
Dim NewPage As TabPageAdv = Me.tabControlAdv1.TabPages(args.NewSelectedIndex)
If NewPage = Me.tab1 Then
MessageBox.Show("Cannot select tab page 1")
args.Cancel = True
End If
End Sub
The
The TreeNodeAdv label is set by setting the
You can specify images for the node using the
The order in which the tree node's contents are drawn is as follows:
The "State image" will be one of OpenImgIndex, ClosedImgIndex and NoChildrenImgIndex.
Selecting specific tree nodes and iterating through the
Tree nodes can be expanded to display the next level of child tree nodes.
The user can expand the tree node by pressing the plus (+) button next to the
TreeNodeAdv, if one is displayed or you can expand the TreeNodeAdv by calling the
The following example displays customer information in a
// Create a new ArrayList to hold the Customer objects.
private ArrayList customerArray = new ArrayList();
private void FillMyTreeView()
{
// Add customers to the ArrayList of Customer objects.
for(int x=0; x!=1000; x++)
{
customerArray.Add(new Customer("Customer" + x.ToString()));
}
// Add orders to each Customer object in the ArrayList.
foreach(Customer customer1 in customerArray)
{
for(int y=0; y!=15; y++)
{
customer1.CustomerOrders.Add(new Order("Order" + y.ToString()));
}
}
// Display a wait cursor while the TreeNodeAdvs are being created.
Cursor.Current = new Cursor("C:\\Cursors\\MyWait.cur");
// Clear the TreeViewAdv each time the method is called.
treeViewAdv1.Nodes.Clear();
// Add a root TreeNodeAdv for each Customer object in the ArrayList.
foreach(Customer customer2 in customerArray)
{
treeViewAdv1.Nodes.Add(new TreeNodeAdv(customer2.CustomerName));
// Add a child treenode for each Order object in the current Customer object.
foreach(Order order1 in customer2.CustomerOrders)
{
treeViewAdv1.Nodes[customerArray.IndexOf(customer2)].Nodes.Add(
new TreeNodeAdv(customer2.CustomerName + "." + order1.OrderID));
}
}
// Reset the cursor to the default for all controls.
Cursor.Current = Cursors.Default;
}
' Create a new ArrayList to hold the Customer objects.
Private customerArray As New ArrayList()
Private Sub FillMyTreeView()
' Add customers to the ArrayList of Customer objects.
Dim x As Integer
For x = 0 To 999
customerArray.Add(New Customer("Customer" + x.ToString()))
Next x
' Add orders to each Customer object in the ArrayList.
Dim customer1 As Customer
For Each customer1 In customerArray
Dim y As Integer
For y = 0 To 14
customer1.CustomerOrders.Add(New Order("Order" + y.ToString()))
Next y
Next customer1
' Display a wait cursor while the TreeNodeAdvs are being created.
Cursor.Current = New Cursor("C:\Cursors\MyWait.cur")
' Clear the TreeViewAdv each time the method is called.
treeViewAdv1.Nodes.Clear()
' Add a root TreeNodeAdv for each Customer object in the ArrayList.
Dim customer2 As Customer
For Each customer2 In customerArray
treeViewAdv1.Nodes.Add(New TreeNodeAdv(customer2.CustomerName))
' Add a child TreeNodeAdv for each Order object in the current Customer object.
Dim order1 As Order
For Each order1 In customer2.CustomerOrders
treeViewAdv1.Nodes(customerArray.IndexOf(customer2)).Nodes.Add( _
New TreeNodeAdv(customer2.CustomerName + "." + order1.OrderID))
Next order1
Next customer2
' Reset the cursor to the default for all controls.
Cursor.Current = System.Windows.Forms.Cursors.Default
' Begin repainting the TreeView.
treeViewAdv1.EndUpdate()
End Sub 'FillMyTreeView
You can also use the
Note that setting this property will fire the
treeNodeAdv.NodeStyle.CheckState = CheckState.Checked;
treeNodeAdv.NodeStyle.CheckState = CheckState.Checked
Any Object derived type may be assigned to this property. If this property is being set through the Windows Forms designer, only text may be assigned.
When the tree node is cloned, if this object is cloneable (implements ICloneable interface) then it will be.
You can also use the more flexible
The path consists of the labels of all of the tree nodes that must be
navigated to get to this tree node, starting at the root tree node. The node
labels are separated by the delimiter character specified in the
This collection contains references to all selected nodes in the TreeViewAdv.
Adding a
Whenever a node is selected/deselected, either by user action or in code, it is automatically added/removed from the SelectedNodes collection.
This collection is read-only, which means you can add and remove elements but cannot change the existing elements.
You can listen to new selections being added to this collection using the collection's
TreeViewPrintDocument printDocument = new TreeViewPrintDocument(this.treeViewAdv1);
printDocument.Print();
Use the following code for print preview:
TreeViewPrintDocument printDocument = new TreeViewPrintDocument(this.treeViewAdv1);
printDocument.PrintPreview();
Use this class (will be referred to as "tracker" below) only when you want to support dropping adjacent (above or below) to a node.
Otherwise simply listen to the
The usage semantics for the tracker is as follows:
By default (when value is negative), the top 1/3 of the node will be considered the top edge.
This value will be used when you allow dropping before a node using
the
By default (when value is negative), the bottom 1/3 of the node will be considered the bottom edge.
This value will be used when you allow dropping below a node using the
The specified Label, if not a child of the BannerPanel will then be made a child of the BannerPanel.
The specified Label, if not a child of the BannerPanel will then be made a child of the BannerPanel.
Call this method whenever you want to save the current expanded state of the task bar boxes in the Isolated Storage.
Note that you do not have to call this method to persist state. You could
use the
Call this method whenever you want to save the current expanded state of the task bar boxes in a custom location (instead of the default Isolated Storage).
Note that you do not have to call this method to persist state. You could
use the
Call this method whenever you want to load the saved expanded states of the task bar boxes from the Isolated Storage.
Note that you do not have to call this method to persist state. You could
use the
Call this method whenever you want to load the saved expanded states of the task bar boxes from a specific location.
Note that you do not have to call this method to persist state. You could
use the
When this property is true, the expanded states of the child task bar boxes are cached as the users expands/collapses them and when this control is disposed, the cached state is persisted in the Isolated Storage.
When the application loads again and when child task bar boxes are added to this control, the saved state is reapplied on the task bar boxes.
State is saved in the Isolated Storage of the system, scoped by the current user identity.
You can also optionally, explicitly control the persistent store and/or
the time of persistence using explicit calls to
This enumeration has the FlagsAttribute that allows a bitwise combination of its member values.
The CommandBar class is a part of the Essential Tools CommandBars framework and allows Windows Forms developers to add to their applications dockable command bars similar to those that are present in the Microsoft Visual Studio.NET and Office XP environments.
The CommandBar, similar to to the MFC/Win32 control bars, is a container control that primarily serves as a host for some other Windows Forms control. The CommandBar class implements the hosting and layout logic while the contained control provides the functional significance.
See
A
ControlBars are supported through the XPMenus framework and can be added to any form that has been initialized
with a
NOTE: The main caption for floating windows is rendered by the Win32 system and cannot be customized.
NOTE: The DockingClientPanel should not be used in MDIContainer forms as the equivalent functionality is provided by the MDIClient window.
If a child form's ControlBox property is set to false, then the control box buttons will be drawn inactive rather than hidden, in accordance with the .NET menus behavior.
If you want to alter this behavior and instead want the control box to be hidden, set this property to false.
private void Form1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(e.Button != MouseButtons.Right)
return;
PopupMenu popup = new PopupMenu();
ParentBarItem parentItem = new ParentBarItem();
barItem1.Checked = true;
barItem1.Click += new EventHandler(ItemClicked);
barItem2.Click += new EventHandler(ItemClicked);
barItem3.Click += new EventHandler(ItemClicked);
parentItem.Items.Add(barItem1);
parentItem.Items.Add(barItem2);
parentItem.Items.Add(barItem3);
popup.ParentBarItem = parentItem;
popup.Show(this, new Point(e.X, e.Y));
}
private void Form1_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
PopupMenu popup = new PopupMenu();
ParentBarItem parentItem = new ParentBarItem();
parentItem.CloseOnClick = false;
barItem1.Checked = true;
barItem1.Click += new EventHandler(ItemClicked);
barItem2.Checked = true;
barItem2.Click += new EventHandler(ItemClicked);
barItem3.Checked = true;
barItem3.Click += new EventHandler(ItemClicked);
parentItem.Items.Add(barItem1);
parentItem.Items.Add(barItem2);
parentItem.Items.Add(barItem3);
popup.ParentBarItem = parentItem;
popup.Show(this, new Point(e.X, e.Y));
}
private void ItemClicked(object sender, EventArgs e)
{
BarItem itemClicked = sender as BarItem;
itemClicked.Checked = !itemClicked.Checked;
}
Use this method in the context of "Automatic MDI Merging" (see
this.popupMenusManager1.SetXPContextMenu(this.richTextBox1, this.popupMenu2);
Me.popupMenusManager1.SetXPContextMenu(Me.richTextBox1, Me.popupMenu2)
This
To use this component, just create it passing the PropertyGrid in the constructor. The context menu will then start appearing for that PropertyGrid. There is no design time support for this component.