WinForm Control ListView "Arithmetic operation resulted in an overflow." - c#

Application goes well in XP,but when it change to Win7,the problem began.
i have checked up all my app codes,but find nothing.
ok,if i just put a single ListView in a new window,and run,also the same problem.
my english is not good,im tired with it,plz help me. thx very much.
public frmChooseBoxes(int flag, string complex)
{
otbList = Ocean_Turnover_BoxManager.GetOcean_Turnover_BoxesBySql("select * from Ocean_Turnover_Box where Status in (2,3) order by boxnum");
//初始化选择框
if (complex != "")
{
myNums = complex;
string[] numbers = complex.Split(',');
nList = new List<string>();
foreach (string number in numbers)
{
nList.Add(number);
}
}
else
{
nList = null;
}
InitializeComponent();
}
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmChooseBoxes));
this.btnExit = new System.Windows.Forms.Button();
this.btnRemoveAll = new System.Windows.Forms.Button();
this.btnRemoveSingle = new System.Windows.Forms.Button();
this.btnAddAll = new System.Windows.Forms.Button();
this.btnAddSingle = new System.Windows.Forms.Button();
this.btnConfirm = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.lvSelectBoxes = new System.Windows.Forms.ListView();
this.lvBox = new System.Windows.Forms.ListView();
this.label3 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtBoxNoChk = new System.Windows.Forms.TextBox();
this.lblBoxNoS = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// btnExit
//
this.btnExit.Location = new System.Drawing.Point(375, 302);
this.btnExit.Name = "btnExit";
this.btnExit.Size = new System.Drawing.Size(75, 23);
this.btnExit.TabIndex = 15;
this.btnExit.Text = "退出";
this.btnExit.UseVisualStyleBackColor = true;
this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
//
// btnRemoveAll
//
this.btnRemoveAll.Location = new System.Drawing.Point(216, 212);
this.btnRemoveAll.Name = "btnRemoveAll";
this.btnRemoveAll.Size = new System.Drawing.Size(30, 23);
this.btnRemoveAll.TabIndex = 14;
this.btnRemoveAll.Text = "<<";
this.btnRemoveAll.UseVisualStyleBackColor = true;
this.btnRemoveAll.Click += new System.EventHandler(this.btnRemoveAll_Click);
//
// btnRemoveSingle
//
this.btnRemoveSingle.Location = new System.Drawing.Point(216, 183);
this.btnRemoveSingle.Name = "btnRemoveSingle";
this.btnRemoveSingle.Size = new System.Drawing.Size(30, 23);
this.btnRemoveSingle.TabIndex = 13;
this.btnRemoveSingle.Text = "<";
this.btnRemoveSingle.UseVisualStyleBackColor = true;
this.btnRemoveSingle.Click += new System.EventHandler(this.btnRemoveSingle_Click);
//
// btnAddAll
//
this.btnAddAll.Location = new System.Drawing.Point(216, 96);
this.btnAddAll.Name = "btnAddAll";
this.btnAddAll.Size = new System.Drawing.Size(30, 23);
this.btnAddAll.TabIndex = 12;
this.btnAddAll.Text = ">>";
this.btnAddAll.UseVisualStyleBackColor = true;
this.btnAddAll.Click += new System.EventHandler(this.btnAddAll_Click);
//
// btnAddSingle
//
this.btnAddSingle.Location = new System.Drawing.Point(216, 67);
this.btnAddSingle.Name = "btnAddSingle";
this.btnAddSingle.Size = new System.Drawing.Size(30, 23);
this.btnAddSingle.TabIndex = 11;
this.btnAddSingle.Text = ">";
this.btnAddSingle.UseVisualStyleBackColor = true;
this.btnAddSingle.Click += new System.EventHandler(this.btnAddSingle_Click);
//
// btnConfirm
//
this.btnConfirm.Location = new System.Drawing.Point(269, 302);
this.btnConfirm.Name = "btnConfirm";
this.btnConfirm.Size = new System.Drawing.Size(75, 23);
this.btnConfirm.TabIndex = 8;
this.btnConfirm.Text = "确定";
this.btnConfirm.UseVisualStyleBackColor = true;
this.btnConfirm.Click += new System.EventHandler(this.btnConfirm_Click);
//
// label1
//
this.label1.Location = new System.Drawing.Point(15, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(92, 16);
this.label1.TabIndex = 16;
this.label1.Text = "周转箱列表:";
//
// label2
//
this.label2.Location = new System.Drawing.Point(267, 9);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(92, 16);
this.label2.TabIndex = 17;
this.label2.Text = "已选择周转箱:";
//
// lvSelectBoxes
//
this.lvSelectBoxes.CheckBoxes = true;
this.lvSelectBoxes.Location = new System.Drawing.Point(269, 44);
this.lvSelectBoxes.Name = "lvSelectBoxes";
this.lvSelectBoxes.Size = new System.Drawing.Size(180, 228);
this.lvSelectBoxes.TabIndex = 18;
this.lvSelectBoxes.UseCompatibleStateImageBehavior = false;
this.lvSelectBoxes.View = System.Windows.Forms.View.List;
//
// lvBox
//
this.lvBox.Location = new System.Drawing.Point(12, 28);
this.lvBox.Name = "lvBox";
this.lvBox.Size = new System.Drawing.Size(180, 244);
this.lvBox.TabIndex = 19;
this.lvBox.UseCompatibleStateImageBehavior = false;
this.lvBox.View = System.Windows.Forms.View.List;
//
// label3
//
this.label3.AutoSize = true;
this.label3.ForeColor = System.Drawing.Color.Red;
this.label3.Location = new System.Drawing.Point(267, 25);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(221, 12);
this.label3.TabIndex = 20;
this.label3.Text = "注:选中复选框表示此箱已满,不可再用";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtBoxNoChk);
this.groupBox1.Controls.Add(this.lblBoxNoS);
this.groupBox1.Location = new System.Drawing.Point(12, 279);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(180, 44);
this.groupBox1.TabIndex = 21;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "筛选箱号:";
//
// txtBoxNoChk
//
this.txtBoxNoChk.Location = new System.Drawing.Point(78, 16);
this.txtBoxNoChk.MaxLength = 5;
this.txtBoxNoChk.Name = "txtBoxNoChk";
this.txtBoxNoChk.Size = new System.Drawing.Size(95, 21);
this.txtBoxNoChk.TabIndex = 1;
this.txtBoxNoChk.TextChanged += new System.EventHandler(this.txtBoxNoChk_TextChanged);
//
// lblBoxNoS
//
this.lblBoxNoS.AutoSize = true;
this.lblBoxNoS.Location = new System.Drawing.Point(7, 23);
this.lblBoxNoS.Name = "lblBoxNoS";
this.lblBoxNoS.Size = new System.Drawing.Size(65, 12);
this.lblBoxNoS.TabIndex = 0;
this.lblBoxNoS.Text = "匹配箱号:";
//
// frmChooseBoxes
//
this.ClientSize = new System.Drawing.Size(492, 346);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.label3);
this.Controls.Add(this.lvBox);
this.Controls.Add(this.lvSelectBoxes);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnExit);
this.Controls.Add(this.btnRemoveAll);
this.Controls.Add(this.btnRemoveSingle);
this.Controls.Add(this.btnAddAll);
this.Controls.Add(this.btnAddSingle);
this.Controls.Add(this.btnConfirm);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "frmChooseBoxes";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "选择箱号";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmChooseBoxes_FormClosing);
this.Load += new System.EventHandler(this.frmChooseBoxes_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}

ok,guys i finally find the answer,its the DotNetSkin.dll that cause the problem.
it cant work well in win7 or server2003,when i commend all the code in relation with it.The Application goes well.
thanks anyway :)

Related

Sitcone in c# could not be found in etc

i get sitcon cant be foundt
Warning MSB3245 Could not resolve this reference. Could not locate the assembly "Siticone.UI". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
and
Error CS0400 The type or namespace name 'Siticone' could not be found in the global namespace (are you missing an assembly reference?)
my code is here
{
// Token: 0x02000002 RID: 2
public partial class Register : global::System.Windows.Forms.Form
{
// Token: 0x06000011 RID: 17 RVA: 0x0000215C File Offset: 0x0000035C
protected override void Dispose(bool disposing)
{
bool flag = disposing && this.components != null;
if (flag)
{
this.components.Dispose();
}
base.Dispose(disposing);
}
// Token: 0x06000012 RID: 18 RVA: 0x00002194 File Offset: 0x00000394
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
Siticone.UI.AnimatorNS.Animation animation2 = new Siticone.UI.AnimatorNS.Animation();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Register));
this.siticoneDragControl1 = new Siticone.UI.WinForms.SiticoneDragControl(this.components);
this.siticoneControlBox1 = new Siticone.UI.WinForms.SiticoneControlBox();
this.siticoneControlBox2 = new Siticone.UI.WinForms.SiticoneControlBox();
this.siticoneTransition1 = new Siticone.UI.WinForms.SiticoneTransition();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.siticoneRoundedButton1 = new Siticone.UI.WinForms.SiticoneRoundedButton();
this.siticoneRoundedButton2 = new Siticone.UI.WinForms.SiticoneRoundedButton();
this.siticoneImageButton1 = new Siticone.UI.WinForms.SiticoneImageButton();
this.email = new Siticone.UI.WinForms.SiticoneRoundedTextBox();
this.password = new Siticone.UI.WinForms.SiticoneRoundedTextBox();
this.username = new Siticone.UI.WinForms.SiticoneRoundedTextBox();
this.license = new Siticone.UI.WinForms.SiticoneRoundedTextBox();
this.siticoneShadowForm = new Siticone.UI.WinForms.SiticoneShadowForm(this.components);
this.SuspendLayout();
//
// siticoneDragControl1
//
this.siticoneDragControl1.TargetControl = this;
//
// siticoneControlBox1
//
this.siticoneControlBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.siticoneControlBox1.BorderRadius = 10;
this.siticoneTransition1.SetDecoration(this.siticoneControlBox1, Siticone.UI.AnimatorNS.DecorationType.None);
this.siticoneControlBox1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(39)))), ((int)(((byte)(42)))));
this.siticoneControlBox1.HoveredState.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(17)))), ((int)(((byte)(35)))));
this.siticoneControlBox1.HoveredState.IconColor = System.Drawing.Color.White;
this.siticoneControlBox1.HoveredState.Parent = this.siticoneControlBox1;
this.siticoneControlBox1.IconColor = System.Drawing.Color.White;
this.siticoneControlBox1.Location = new System.Drawing.Point(367, 5);
this.siticoneControlBox1.Margin = new System.Windows.Forms.Padding(4);
this.siticoneControlBox1.Name = "siticoneControlBox1";
this.siticoneControlBox1.ShadowDecoration.Parent = this.siticoneControlBox1;
this.siticoneControlBox1.Size = new System.Drawing.Size(60, 36);
this.siticoneControlBox1.TabIndex = 1;
this.siticoneControlBox1.Click += new System.EventHandler(this.siticoneControlBox1_Click);
//
// siticoneControlBox2
//
this.siticoneControlBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.siticoneControlBox2.BorderRadius = 10;
this.siticoneControlBox2.ControlBoxType = Siticone.UI.WinForms.Enums.ControlBoxType.MinimizeBox;
this.siticoneTransition1.SetDecoration(this.siticoneControlBox2, Siticone.UI.AnimatorNS.DecorationType.None);
this.siticoneControlBox2.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(39)))), ((int)(((byte)(42)))));
this.siticoneControlBox2.HoveredState.Parent = this.siticoneControlBox2;
this.siticoneControlBox2.IconColor = System.Drawing.Color.White;
this.siticoneControlBox2.Location = new System.Drawing.Point(306, 5);
this.siticoneControlBox2.Margin = new System.Windows.Forms.Padding(4);
this.siticoneControlBox2.Name = "siticoneControlBox2";
this.siticoneControlBox2.ShadowDecoration.Parent = this.siticoneControlBox2;
this.siticoneControlBox2.Size = new System.Drawing.Size(60, 36);
this.siticoneControlBox2.TabIndex = 2;
//
// siticoneTransition1
//
this.siticoneTransition1.AnimationType = Siticone.UI.AnimatorNS.AnimationType.Rotate;
this.siticoneTransition1.Cursor = null;
animation2.AnimateOnlyDifferences = true;
animation2.BlindCoeff = ((System.Drawing.PointF)(resources.GetObject("animation2.BlindCoeff")));
animation2.LeafCoeff = 0F;
animation2.MaxTime = 1F;
animation2.MinTime = 0F;
animation2.MosaicCoeff = ((System.Drawing.PointF)(resources.GetObject("animation2.MosaicCoeff")));
animation2.MosaicShift = ((System.Drawing.PointF)(resources.GetObject("animation2.MosaicShift")));
animation2.MosaicSize = 0;
animation2.Padding = new System.Windows.Forms.Padding(50);
animation2.RotateCoeff = 1F;
animation2.RotateLimit = 0F;
animation2.ScaleCoeff = ((System.Drawing.PointF)(resources.GetObject("animation2.ScaleCoeff")));
animation2.SlideCoeff = ((System.Drawing.PointF)(resources.GetObject("animation2.SlideCoeff")));
animation2.TimeCoeff = 0F;
animation2.TransparencyCoeff = 1F;
this.siticoneTransition1.DefaultAnimation = animation2;
//
// label1
//
this.label1.AutoSize = true;
this.siticoneTransition1.SetDecoration(this.label1, Siticone.UI.AnimatorNS.DecorationType.None);
this.label1.Font = new System.Drawing.Font("Segoe UI Light", 10F);
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(-1, 167);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(0, 23);
this.label1.TabIndex = 22;
//
// label2
//
this.label2.AutoSize = true;
this.siticoneTransition1.SetDecoration(this.label2, Siticone.UI.AnimatorNS.DecorationType.None);
this.label2.Font = new System.Drawing.Font("Segoe UI Semibold", 10.2F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.ForeColor = System.Drawing.SystemColors.ButtonFace;
this.label2.Location = new System.Drawing.Point(13, 13);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(152, 23);
this.label2.TabIndex = 27;
this.label2.Text = "Auth.GG | Register";
//
// siticoneRoundedButton1
//
this.siticoneRoundedButton1.BorderColor = System.Drawing.Color.DodgerBlue;
this.siticoneRoundedButton1.BorderThickness = 1;
this.siticoneRoundedButton1.CheckedState.Parent = this.siticoneRoundedButton1;
this.siticoneRoundedButton1.CustomImages.Parent = this.siticoneRoundedButton1;
this.siticoneTransition1.SetDecoration(this.siticoneRoundedButton1, Siticone.UI.AnimatorNS.DecorationType.None);
this.siticoneRoundedButton1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(7)))), ((int)(((byte)(127)))), ((int)(((byte)(243)))));
this.siticoneRoundedButton1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.siticoneRoundedButton1.ForeColor = System.Drawing.Color.White;
this.siticoneRoundedButton1.HoveredState.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(218)))), ((int)(((byte)(223)))));
this.siticoneRoundedButton1.HoveredState.Parent = this.siticoneRoundedButton1;
this.siticoneRoundedButton1.Location = new System.Drawing.Point(46, 349);
this.siticoneRoundedButton1.Margin = new System.Windows.Forms.Padding(4);
this.siticoneRoundedButton1.Name = "siticoneRoundedButton1";
this.siticoneRoundedButton1.ShadowDecoration.Parent = this.siticoneRoundedButton1;
this.siticoneRoundedButton1.Size = new System.Drawing.Size(340, 33);
this.siticoneRoundedButton1.TabIndex = 26;
this.siticoneRoundedButton1.Text = "Back to Login";
this.siticoneRoundedButton1.Click += new System.EventHandler(this.siticoneRoundedButton1_Click);
//
// siticoneRoundedButton2
//
this.siticoneRoundedButton2.BorderColor = System.Drawing.Color.DodgerBlue;
this.siticoneRoundedButton2.BorderThickness = 1;
this.siticoneRoundedButton2.CheckedState.Parent = this.siticoneRoundedButton2;
this.siticoneRoundedButton2.CustomImages.Parent = this.siticoneRoundedButton2;
this.siticoneTransition1.SetDecoration(this.siticoneRoundedButton2, Siticone.UI.AnimatorNS.DecorationType.None);
this.siticoneRoundedButton2.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(7)))), ((int)(((byte)(127)))), ((int)(((byte)(243)))));
this.siticoneRoundedButton2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.siticoneRoundedButton2.ForeColor = System.Drawing.Color.White;
this.siticoneRoundedButton2.HoveredState.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(218)))), ((int)(((byte)(223)))));
this.siticoneRoundedButton2.HoveredState.Parent = this.siticoneRoundedButton2;
this.siticoneRoundedButton2.Location = new System.Drawing.Point(46, 308);
this.siticoneRoundedButton2.Margin = new System.Windows.Forms.Padding(4);
this.siticoneRoundedButton2.Name = "siticoneRoundedButton2";
this.siticoneRoundedButton2.ShadowDecoration.Parent = this.siticoneRoundedButton2;
this.siticoneRoundedButton2.Size = new System.Drawing.Size(340, 33);
this.siticoneRoundedButton2.TabIndex = 28;
this.siticoneRoundedButton2.Text = "Register";
this.siticoneRoundedButton2.Click += new System.EventHandler(this.siticoneRoundedButton2_Click);
//
// siticoneImageButton1
//
this.siticoneImageButton1.BackColor = System.Drawing.Color.Transparent;
this.siticoneImageButton1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.siticoneImageButton1.CheckedState.Parent = this.siticoneImageButton1;
this.siticoneTransition1.SetDecoration(this.siticoneImageButton1, Siticone.UI.AnimatorNS.DecorationType.None);
this.siticoneImageButton1.HoveredState.ImageSize = new System.Drawing.Size(200, 100);
this.siticoneImageButton1.HoveredState.Parent = this.siticoneImageButton1;
this.siticoneImageButton1.Image = ((System.Drawing.Image)(resources.GetObject("siticoneImageButton1.Image")));
this.siticoneImageButton1.ImageSize = new System.Drawing.Size(200, 100);
this.siticoneImageButton1.Location = new System.Drawing.Point(9, 43);
this.siticoneImageButton1.Name = "siticoneImageButton1";
this.siticoneImageButton1.PressedState.ImageSize = new System.Drawing.Size(200, 100);
this.siticoneImageButton1.PressedState.Parent = this.siticoneImageButton1;
this.siticoneImageButton1.Size = new System.Drawing.Size(406, 66);
this.siticoneImageButton1.TabIndex = 33;
//
// email
//
this.email.AllowDrop = true;
this.email.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(7)))), ((int)(((byte)(127)))), ((int)(((byte)(243)))));
this.email.Cursor = System.Windows.Forms.Cursors.IBeam;
this.siticoneTransition1.SetDecoration(this.email, Siticone.UI.AnimatorNS.DecorationType.None);
this.email.DefaultText = "Email";
this.email.DisabledState.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(208)))), ((int)(((byte)(208)))));
this.email.DisabledState.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(226)))), ((int)(((byte)(226)))), ((int)(((byte)(226)))));
this.email.DisabledState.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(138)))), ((int)(((byte)(138)))), ((int)(((byte)(138)))));
this.email.DisabledState.Parent = this.email;
this.email.DisabledState.PlaceholderForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(138)))), ((int)(((byte)(138)))), ((int)(((byte)(138)))));
this.email.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(39)))), ((int)(((byte)(42)))));
this.email.FocusedState.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(94)))), ((int)(((byte)(148)))), ((int)(((byte)(255)))));
this.email.FocusedState.Parent = this.email;
this.email.HoveredState.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(94)))), ((int)(((byte)(148)))), ((int)(((byte)(255)))));
this.email.HoveredState.Parent = this.email;
this.email.Location = new System.Drawing.Point(56, 206);
this.email.Margin = new System.Windows.Forms.Padding(5);
this.email.Name = "email";
this.email.PasswordChar = '\0';
this.email.PlaceholderText = "";
this.email.SelectedText = "";
this.email.ShadowDecoration.Parent = this.email;
this.email.Size = new System.Drawing.Size(315, 37);
this.email.TabIndex = 34;
this.email.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// password
//
this.password.AllowDrop = true;
this.password.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(7)))), ((int)(((byte)(127)))), ((int)(((byte)(243)))));
this.password.Cursor = System.Windows.Forms.Cursors.IBeam;
this.siticoneTransition1.SetDecoration(this.password, Siticone.UI.AnimatorNS.DecorationType.None);
this.password.DefaultText = "Password";
this.password.DisabledState.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(208)))), ((int)(((byte)(208)))));
this.password.DisabledState.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(226)))), ((int)(((byte)(226)))), ((int)(((byte)(226)))));
this.password.DisabledState.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(138)))), ((int)(((byte)(138)))), ((int)(((byte)(138)))));
this.password.DisabledState.Parent = this.password;
this.password.DisabledState.PlaceholderForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(138)))), ((int)(((byte)(138)))), ((int)(((byte)(138)))));
this.password.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(39)))), ((int)(((byte)(42)))));
this.password.FocusedState.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(94)))), ((int)(((byte)(148)))), ((int)(((byte)(255)))));
this.password.FocusedState.Parent = this.password;
this.password.HoveredState.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(94)))), ((int)(((byte)(148)))), ((int)(((byte)(255)))));
this.password.HoveredState.Parent = this.password;
this.password.Location = new System.Drawing.Point(56, 162);
this.password.Margin = new System.Windows.Forms.Padding(5);
this.password.Name = "password";
this.password.PasswordChar = '\0';
this.password.PlaceholderText = "";
this.password.SelectedText = "";
this.password.ShadowDecoration.Parent = this.password;
this.password.Size = new System.Drawing.Size(315, 37);
this.password.TabIndex = 35;
this.password.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// username
//
this.username.AllowDrop = true;
this.username.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(7)))), ((int)(((byte)(127)))), ((int)(((byte)(243)))));
this.username.Cursor = System.Windows.Forms.Cursors.IBeam;
this.siticoneTransition1.SetDecoration(this.username, Siticone.UI.AnimatorNS.DecorationType.None);
this.username.DefaultText = "Username";
this.username.DisabledState.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(208)))), ((int)(((byte)(208)))));
this.username.DisabledState.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(226)))), ((int)(((byte)(226)))), ((int)(((byte)(226)))));
this.username.DisabledState.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(138)))), ((int)(((byte)(138)))), ((int)(((byte)(138)))));
this.username.DisabledState.Parent = this.username;
this.username.DisabledState.PlaceholderForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(138)))), ((int)(((byte)(138)))), ((int)(((byte)(138)))));
this.username.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(39)))), ((int)(((byte)(42)))));
this.username.FocusedState.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(94)))), ((int)(((byte)(148)))), ((int)(((byte)(255)))));
this.username.FocusedState.Parent = this.username;
this.username.HoveredState.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(94)))), ((int)(((byte)(148)))), ((int)(((byte)(255)))));
this.username.HoveredState.Parent = this.username;
this.username.Location = new System.Drawing.Point(56, 116);
this.username.Margin = new System.Windows.Forms.Padding(5);
this.username.Name = "username";
this.username.PasswordChar = '\0';
this.username.PlaceholderText = "";
this.username.SelectedText = "";
this.username.ShadowDecoration.Parent = this.username;
this.username.Size = new System.Drawing.Size(315, 37);
this.username.TabIndex = 36;
this.username.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// license
//
this.license.AllowDrop = true;
this.license.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(7)))), ((int)(((byte)(127)))), ((int)(((byte)(243)))));
this.license.Cursor = System.Windows.Forms.Cursors.IBeam;
this.siticoneTransition1.SetDecoration(this.license, Siticone.UI.AnimatorNS.DecorationType.None);
this.license.DefaultText = "License";
this.license.DisabledState.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(208)))), ((int)(((byte)(208)))));
this.license.DisabledState.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(226)))), ((int)(((byte)(226)))), ((int)(((byte)(226)))));
this.license.DisabledState.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(138)))), ((int)(((byte)(138)))), ((int)(((byte)(138)))));
this.license.DisabledState.Parent = this.license;
this.license.DisabledState.PlaceholderForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(138)))), ((int)(((byte)(138)))), ((int)(((byte)(138)))));
this.license.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(39)))), ((int)(((byte)(42)))));
this.license.FocusedState.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(94)))), ((int)(((byte)(148)))), ((int)(((byte)(255)))));
this.license.FocusedState.Parent = this.license;
this.license.HoveredState.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(94)))), ((int)(((byte)(148)))), ((int)(((byte)(255)))));
this.license.HoveredState.Parent = this.license;
this.license.Location = new System.Drawing.Point(56, 253);
this.license.Margin = new System.Windows.Forms.Padding(5);
this.license.Name = "license";
this.license.PasswordChar = '\0';
this.license.PlaceholderText = "";
this.license.SelectedText = "";
this.license.ShadowDecoration.Parent = this.license;
this.license.Size = new System.Drawing.Size(315, 37);
this.license.TabIndex = 37;
this.license.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// Register
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoValidate = System.Windows.Forms.AutoValidate.Disable;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(35)))), ((int)(((byte)(39)))), ((int)(((byte)(42)))));
this.ClientSize = new System.Drawing.Size(432, 395);
this.Controls.Add(this.license);
this.Controls.Add(this.username);
this.Controls.Add(this.password);
this.Controls.Add(this.email);
this.Controls.Add(this.siticoneImageButton1);
this.Controls.Add(this.siticoneRoundedButton2);
this.Controls.Add(this.label2);
this.Controls.Add(this.siticoneRoundedButton1);
this.Controls.Add(this.label1);
this.Controls.Add(this.siticoneControlBox2);
this.Controls.Add(this.siticoneControlBox1);
this.siticoneTransition1.SetDecoration(this, Siticone.UI.AnimatorNS.DecorationType.BottomMirror);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "Register";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Auth.GG WInform";
this.TransparencyKey = System.Drawing.Color.Maroon;
this.ResumeLayout(false);
this.PerformLayout();
}
// Token: 0x04000001 RID: 1
private global::System.ComponentModel.IContainer components = null;
// Token: 0x04000002 RID: 2
private global::Siticone.UI.WinForms.SiticoneDragControl siticoneDragControl1;
// Token: 0x04000004 RID: 4
private global::Siticone.UI.WinForms.SiticoneControlBox siticoneControlBox1;
// Token: 0x04000005 RID: 5
private global::Siticone.UI.WinForms.SiticoneControlBox siticoneControlBox2;
// Token: 0x04000009 RID: 9
private global::Siticone.UI.WinForms.SiticoneTransition siticoneTransition1;
// Token: 0x0400000A RID: 10
private global::System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private Siticone.UI.WinForms.SiticoneRoundedButton siticoneRoundedButton1;
private Siticone.UI.WinForms.SiticoneShadowForm siticoneShadowForm;
private Siticone.UI.WinForms.SiticoneRoundedButton siticoneRoundedButton2;
private Siticone.UI.WinForms.SiticoneImageButton siticoneImageButton1;
private Siticone.UI.WinForms.SiticoneRoundedTextBox license;
private Siticone.UI.WinForms.SiticoneRoundedTextBox username;
private Siticone.UI.WinForms.SiticoneRoundedTextBox password;
private Siticone.UI.WinForms.SiticoneRoundedTextBox email;
}
}```
Make sure that Siticone Library is present in your project (in bin folder) and the library is referenced "using Siticone..."
There is a newer version Siticone.Desktop.UI 2.0.04, use that one.

How to display milliseconds into “days : hours : minutes : seconds” in Infragistics UltraChart?

I'm using Infragistics UltraChart controls for displaying graphs. (Version 19.1)
My line chart graph is as below
Here Y-axis is noting but milliseconds(turn around time of Int64 type), I want to display it like "days:hh:mm:ss" format. Is it possible to display Y- axis lables in this format? while X axis is showing list of sample names (Which is of string type) The Ultra line chart data binding code is as below
ultraChartTAT.Data.DataSource = dsTAT.Tables["dtTAT"];
ultraChartTAT.Data.DataBind();
Here ultraChartTAT is an UltraChart infragistic control and dsTAT is a DataSet. The dsTAT.Tables["dtTAT"] design structure is as below
DataTable dtTAT = new DataTable("dtTAT");
dtTAT.Columns.Add("TAT", typeof(string));
dtTAT.Columns.Add("Sample1", typeof(Int64));
dtTAT.Columns.Add("Sample2", typeof(Int64));
dtTAT.Columns.Add("Sample3", typeof(Int64));
dtTAT.Columns.Add("Sample4", typeof(Int64));
dtTAT.Columns.Add("Sample5", typeof(Int64));
dtTAT.Columns.Add("Sample6", typeof(Int64));
dtTAT.Columns.Add("Sample7", typeof(Int64));
dtTAT.Columns.Add("Sample8", typeof(Int64));
For more reference take a look on this link https://stackoverflow.com/a/36329469/4524485
In case if any other information is required then add it in comment I'll update my question accordingly.
To format data for the X/Y axis labels the IRenderLabel interface can be used.
In example below the DateTimeRenderer class is using the IRenderLabel interface implementation to display Y-axis labels in the DateTime format:
For additional information see the Infragistics documentation:
http://help.infragistics.com/Help/Doc/WinForms/2011.1/CLR2.0/html/Chart_Customize_Labels_Using_the_IRenderLabel_Interface.html
DateTimeRenderer.cs
using Infragistics.UltraChart.Resources;
using System;
using System.Collections;
using System.Data;
namespace UltraGrid
{
public class DateTimeRenderer : IRenderLabel
{
readonly DataTable source;
public DateTimeRenderer(DataTable dt)
{
source = dt;
}
public string ToString(Hashtable context)
{
double dataValue = (double)context["DATA_VALUE"];
var dt = new DateTime((long)dataValue);
return dt.ToString("MM/dd/yyyy HH:mm:ss");
}
}
}
Form1.cs
using System;
using System.Collections;
using System.Data;
using System.Windows.Forms;
namespace UltraGrid
{
public partial class Form1 : Form
{
DataTable table = new DataTable("Statistics");
public Form1()
{
InitializeComponent();
// Create columns to hold sample data.
var column1 = new DataColumn("Sample", typeof(string));
var column2 = new DataColumn("Line1", typeof(Int64));
var column3 = new DataColumn("Line2", typeof(Int64));
var column4 = new DataColumn("Line3", typeof(Int64));
table.Columns.AddRange(new DataColumn[] { column1, column2, column3, column4 });
var now = DateTime.Now.Ticks;
var rnd = new Random();
for (int i = 1; i < 20; i++)
{
table.Rows.Add(new object[] { "Sample" + i.ToString(), now + rnd.Next(999, 3600000)*1000, now + rnd.Next(999, 3600000)*1000, now + rnd.Next(999, 3600000)*1000 });
}
}
private void LineChartStyles_Load(object sender, System.EventArgs e)
{
this.ultraChart1.Data.DataSource = table;
ultraChart1.Axis.Y.Labels.ItemFormatString = "<MY_VALUE>";
ultraChart1.Tooltips.FormatString = "<MY_VALUE>";
var MyLabelHashTable = new Hashtable { { "MY_VALUE", new DateTimeRenderer(table) } };
this.ultraChart1.LabelHash = MyLabelHashTable;
this.ultraChart1.Data.DataBind();
}
}
}
Form1.Designer.cs
namespace UltraGrid
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
Infragistics.UltraChart.Resources.Appearance.PaintElement paintElement1 = new Infragistics.UltraChart.Resources.Appearance.PaintElement();
Infragistics.UltraChart.Resources.Appearance.PaintElement paintElement2 = new Infragistics.UltraChart.Resources.Appearance.PaintElement();
Infragistics.UltraChart.Resources.Appearance.PaintElement paintElement3 = new Infragistics.UltraChart.Resources.Appearance.PaintElement();
Infragistics.UltraChart.Resources.Appearance.PaintElement paintElement4 = new Infragistics.UltraChart.Resources.Appearance.PaintElement();
Infragistics.UltraChart.Resources.Appearance.PaintElement paintElement5 = new Infragistics.UltraChart.Resources.Appearance.PaintElement();
Infragistics.UltraChart.Resources.Appearance.PaintElement paintElement6 = new Infragistics.UltraChart.Resources.Appearance.PaintElement();
Infragistics.UltraChart.Resources.Appearance.LineChartAppearance lineChartAppearance1 = new Infragistics.UltraChart.Resources.Appearance.LineChartAppearance();
Infragistics.UltraChart.Resources.Appearance.LineAppearance lineAppearance1 = new Infragistics.UltraChart.Resources.Appearance.LineAppearance() { Thickness = 3 };
Infragistics.UltraChart.Resources.Appearance.PaintElement paintElement7 = new Infragistics.UltraChart.Resources.Appearance.PaintElement();
Infragistics.UltraChart.Resources.Appearance.LineAppearance lineAppearance2 = new Infragistics.UltraChart.Resources.Appearance.LineAppearance() { Thickness = 3 };
Infragistics.UltraChart.Resources.Appearance.PaintElement paintElement8 = new Infragistics.UltraChart.Resources.Appearance.PaintElement();
Infragistics.UltraChart.Resources.Appearance.LineAppearance lineAppearance3 = new Infragistics.UltraChart.Resources.Appearance.LineAppearance() { Thickness = 3 };
Infragistics.UltraChart.Resources.Appearance.PaintElement paintElement9 = new Infragistics.UltraChart.Resources.Appearance.PaintElement();
this.ultraChart1 = new Infragistics.Win.UltraWinChart.UltraChart();
((System.ComponentModel.ISupportInitialize)(this.ultraChart1)).BeginInit();
this.SuspendLayout();
this.ultraChart1.ChartType = Infragistics.UltraChart.Shared.Styles.ChartType.LineChart;
//
// ultraChart1
//
resources.ApplyResources(this.ultraChart1, "ultraChart1");
this.ultraChart1.Axis.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(248)))), ((int)(((byte)(220)))));
paintElement1.ElementType = Infragistics.UltraChart.Shared.Styles.PaintElementType.None;
paintElement1.Fill = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(248)))), ((int)(((byte)(220)))));
this.ultraChart1.Axis.PE = paintElement1;
this.ultraChart1.Axis.X.Labels.Font = new System.Drawing.Font("Verdana", 7F);
this.ultraChart1.Axis.X.Labels.HorizontalAlign = System.Drawing.StringAlignment.Near;
this.ultraChart1.Axis.X.Labels.ItemFormatString = "<ITEM_LABEL>";
this.ultraChart1.Axis.X.Labels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing;
this.ultraChart1.Axis.X.Labels.SeriesLabels.Font = new System.Drawing.Font("Verdana", 7F);
this.ultraChart1.Axis.X.Labels.SeriesLabels.FormatString = "";
this.ultraChart1.Axis.X.Labels.SeriesLabels.HorizontalAlign = System.Drawing.StringAlignment.Near;
this.ultraChart1.Axis.X.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing;
this.ultraChart1.Axis.X.Labels.SeriesLabels.VerticalAlign = System.Drawing.StringAlignment.Center;
this.ultraChart1.Axis.X.Labels.SeriesLabels.Visible = true;
this.ultraChart1.Axis.X.Labels.VerticalAlign = System.Drawing.StringAlignment.Center;
this.ultraChart1.Axis.X.Labels.Visible = true;
this.ultraChart1.Axis.X.LineThickness = 1;
this.ultraChart1.Axis.X.MajorGridLines.AlphaLevel = ((byte)(255));
this.ultraChart1.Axis.X.MajorGridLines.Color = System.Drawing.Color.Gainsboro;
this.ultraChart1.Axis.X.MajorGridLines.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dot;
this.ultraChart1.Axis.X.MajorGridLines.Visible = true;
this.ultraChart1.Axis.X.MinorGridLines.AlphaLevel = ((byte)(255));
this.ultraChart1.Axis.X.MinorGridLines.Color = System.Drawing.Color.LightGray;
this.ultraChart1.Axis.X.MinorGridLines.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dot;
this.ultraChart1.Axis.X.MinorGridLines.Visible = false;
this.ultraChart1.Axis.X.Visible = true;
this.ultraChart1.Axis.X2.Labels.Font = new System.Drawing.Font("Verdana", 7F);
this.ultraChart1.Axis.X2.Labels.HorizontalAlign = System.Drawing.StringAlignment.Far;
this.ultraChart1.Axis.X2.Labels.ItemFormatString = "<ITEM_LABEL>";
this.ultraChart1.Axis.X2.Labels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing;
this.ultraChart1.Axis.X2.Labels.SeriesLabels.FormatString = "";
this.ultraChart1.Axis.X2.Labels.SeriesLabels.HorizontalAlign = System.Drawing.StringAlignment.Far;
this.ultraChart1.Axis.X2.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.VerticalLeftFacing;
this.ultraChart1.Axis.X2.Labels.SeriesLabels.VerticalAlign = System.Drawing.StringAlignment.Center;
this.ultraChart1.Axis.X2.Labels.SeriesLabels.Visible = true;
this.ultraChart1.Axis.X2.Labels.VerticalAlign = System.Drawing.StringAlignment.Center;
this.ultraChart1.Axis.X2.Labels.Visible = false;
this.ultraChart1.Axis.X2.MajorGridLines.AlphaLevel = ((byte)(255));
this.ultraChart1.Axis.X2.MajorGridLines.Color = System.Drawing.Color.Gainsboro;
this.ultraChart1.Axis.X2.MajorGridLines.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dot;
this.ultraChart1.Axis.X2.MajorGridLines.Visible = true;
this.ultraChart1.Axis.X2.MinorGridLines.AlphaLevel = ((byte)(255));
this.ultraChart1.Axis.X2.MinorGridLines.Color = System.Drawing.Color.LightGray;
this.ultraChart1.Axis.X2.MinorGridLines.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dot;
this.ultraChart1.Axis.X2.MinorGridLines.Visible = false;
this.ultraChart1.Axis.X2.Visible = false;
this.ultraChart1.Axis.Y.Extent = 110;
this.ultraChart1.Axis.Y.Labels.Font = new System.Drawing.Font("Verdana", 7F);
this.ultraChart1.Axis.Y.Labels.HorizontalAlign = System.Drawing.StringAlignment.Far;
this.ultraChart1.Axis.Y.Labels.ItemFormatString = "<DATA_VALUE:00.##>";
this.ultraChart1.Axis.Y.Labels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.Horizontal;
this.ultraChart1.Axis.Y.Labels.SeriesLabels.FormatString = "";
this.ultraChart1.Axis.Y.Labels.SeriesLabels.HorizontalAlign = System.Drawing.StringAlignment.Far;
this.ultraChart1.Axis.Y.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.Horizontal;
this.ultraChart1.Axis.Y.Labels.SeriesLabels.VerticalAlign = System.Drawing.StringAlignment.Center;
this.ultraChart1.Axis.Y.Labels.SeriesLabels.Visible = true;
this.ultraChart1.Axis.Y.Labels.VerticalAlign = System.Drawing.StringAlignment.Center;
this.ultraChart1.Axis.Y.Labels.Visible = true;
this.ultraChart1.Axis.Y.LineThickness = 1;
this.ultraChart1.Axis.Y.MajorGridLines.AlphaLevel = ((byte)(255));
this.ultraChart1.Axis.Y.MajorGridLines.Color = System.Drawing.Color.Gainsboro;
this.ultraChart1.Axis.Y.MajorGridLines.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dot;
this.ultraChart1.Axis.Y.MajorGridLines.Visible = true;
this.ultraChart1.Axis.Y.MinorGridLines.AlphaLevel = ((byte)(255));
this.ultraChart1.Axis.Y.MinorGridLines.Color = System.Drawing.Color.LightGray;
this.ultraChart1.Axis.Y.MinorGridLines.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dot;
this.ultraChart1.Axis.Y.MinorGridLines.Visible = false;
this.ultraChart1.Axis.Y.TickmarkInterval = 50D;
this.ultraChart1.Axis.Y.TickmarkStyle = Infragistics.UltraChart.Shared.Styles.AxisTickStyle.Smart;
this.ultraChart1.Axis.Y.Visible = true;
this.ultraChart1.Axis.Y2.Labels.Font = new System.Drawing.Font("Verdana", 7F);
this.ultraChart1.Axis.Y2.Labels.HorizontalAlign = System.Drawing.StringAlignment.Near;
this.ultraChart1.Axis.Y2.Labels.ItemFormatString = "<DATA_VALUE:00.##>";
this.ultraChart1.Axis.Y2.Labels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.Horizontal;
this.ultraChart1.Axis.Y2.Labels.SeriesLabels.FormatString = "";
this.ultraChart1.Axis.Y2.Labels.SeriesLabels.HorizontalAlign = System.Drawing.StringAlignment.Near;
this.ultraChart1.Axis.Y2.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.Horizontal;
this.ultraChart1.Axis.Y2.Labels.SeriesLabels.VerticalAlign = System.Drawing.StringAlignment.Center;
this.ultraChart1.Axis.Y2.Labels.SeriesLabels.Visible = true;
this.ultraChart1.Axis.Y2.Labels.VerticalAlign = System.Drawing.StringAlignment.Center;
this.ultraChart1.Axis.Y2.Labels.Visible = false;
this.ultraChart1.Axis.Y2.MajorGridLines.AlphaLevel = ((byte)(255));
this.ultraChart1.Axis.Y2.MajorGridLines.Color = System.Drawing.Color.Gainsboro;
this.ultraChart1.Axis.Y2.MajorGridLines.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dot;
this.ultraChart1.Axis.Y2.MajorGridLines.Visible = true;
this.ultraChart1.Axis.Y2.MinorGridLines.AlphaLevel = ((byte)(255));
this.ultraChart1.Axis.Y2.MinorGridLines.Color = System.Drawing.Color.LightGray;
this.ultraChart1.Axis.Y2.MinorGridLines.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dot;
this.ultraChart1.Axis.Y2.MinorGridLines.Visible = false;
this.ultraChart1.Axis.Y2.Visible = false;
this.ultraChart1.Axis.Z.Labels.Font = new System.Drawing.Font("Verdana", 7F);
this.ultraChart1.Axis.Z.Labels.HorizontalAlign = System.Drawing.StringAlignment.Near;
this.ultraChart1.Axis.Z.Labels.ItemFormatString = "";
this.ultraChart1.Axis.Z.Labels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.Horizontal;
this.ultraChart1.Axis.Z.Labels.SeriesLabels.HorizontalAlign = System.Drawing.StringAlignment.Near;
this.ultraChart1.Axis.Z.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.Horizontal;
this.ultraChart1.Axis.Z.Labels.SeriesLabels.VerticalAlign = System.Drawing.StringAlignment.Center;
this.ultraChart1.Axis.Z.Labels.SeriesLabels.Visible = true;
this.ultraChart1.Axis.Z.Labels.VerticalAlign = System.Drawing.StringAlignment.Center;
this.ultraChart1.Axis.Z.Labels.Visible = true;
this.ultraChart1.Axis.Z.MajorGridLines.AlphaLevel = ((byte)(255));
this.ultraChart1.Axis.Z.MajorGridLines.Color = System.Drawing.Color.Gainsboro;
this.ultraChart1.Axis.Z.MajorGridLines.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dot;
this.ultraChart1.Axis.Z.MajorGridLines.Visible = true;
this.ultraChart1.Axis.Z.MinorGridLines.AlphaLevel = ((byte)(255));
this.ultraChart1.Axis.Z.MinorGridLines.Color = System.Drawing.Color.LightGray;
this.ultraChart1.Axis.Z.MinorGridLines.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dot;
this.ultraChart1.Axis.Z.MinorGridLines.Visible = false;
this.ultraChart1.Axis.Z.Visible = false;
this.ultraChart1.Axis.Z2.Labels.Font = new System.Drawing.Font("Verdana", 7F);
this.ultraChart1.Axis.Z2.Labels.HorizontalAlign = System.Drawing.StringAlignment.Near;
this.ultraChart1.Axis.Z2.Labels.ItemFormatString = "";
this.ultraChart1.Axis.Z2.Labels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.Horizontal;
this.ultraChart1.Axis.Z2.Labels.SeriesLabels.HorizontalAlign = System.Drawing.StringAlignment.Near;
this.ultraChart1.Axis.Z2.Labels.SeriesLabels.Orientation = Infragistics.UltraChart.Shared.Styles.TextOrientation.Horizontal;
this.ultraChart1.Axis.Z2.Labels.SeriesLabels.VerticalAlign = System.Drawing.StringAlignment.Center;
this.ultraChart1.Axis.Z2.Labels.SeriesLabels.Visible = true;
this.ultraChart1.Axis.Z2.Labels.VerticalAlign = System.Drawing.StringAlignment.Center;
this.ultraChart1.Axis.Z2.Labels.Visible = false;
this.ultraChart1.Axis.Z2.MajorGridLines.AlphaLevel = ((byte)(255));
this.ultraChart1.Axis.Z2.MajorGridLines.Color = System.Drawing.Color.Gainsboro;
this.ultraChart1.Axis.Z2.MajorGridLines.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dot;
this.ultraChart1.Axis.Z2.MajorGridLines.Visible = true;
this.ultraChart1.Axis.Z2.MinorGridLines.AlphaLevel = ((byte)(255));
this.ultraChart1.Axis.Z2.MinorGridLines.Color = System.Drawing.Color.LightGray;
this.ultraChart1.Axis.Z2.MinorGridLines.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dot;
this.ultraChart1.Axis.Z2.MinorGridLines.Visible = false;
this.ultraChart1.Axis.Z2.Visible = false;
this.ultraChart1.Border.CornerRadius = 5;
this.ultraChart1.ColorModel.AlphaLevel = ((byte)(150));
this.ultraChart1.ColorModel.ModelStyle = Infragistics.UltraChart.Shared.Styles.ColorModels.CustomLinear;
paintElement2.ElementType = Infragistics.UltraChart.Shared.Styles.PaintElementType.Gradient;
paintElement2.Fill = System.Drawing.Color.FromArgb(((int)(((byte)(108)))), ((int)(((byte)(162)))), ((int)(((byte)(36)))));
paintElement2.FillGradientStyle = Infragistics.UltraChart.Shared.Styles.GradientStyle.Horizontal;
paintElement2.FillStopColor = System.Drawing.Color.FromArgb(((int)(((byte)(148)))), ((int)(((byte)(244)))), ((int)(((byte)(17)))));
paintElement2.Stroke = System.Drawing.Color.Transparent;
paintElement3.ElementType = Infragistics.UltraChart.Shared.Styles.PaintElementType.Gradient;
paintElement3.Fill = System.Drawing.Color.FromArgb(((int)(((byte)(7)))), ((int)(((byte)(108)))), ((int)(((byte)(176)))));
paintElement3.FillGradientStyle = Infragistics.UltraChart.Shared.Styles.GradientStyle.Horizontal;
paintElement3.FillStopColor = System.Drawing.Color.FromArgb(((int)(((byte)(53)))), ((int)(((byte)(200)))), ((int)(((byte)(255)))));
paintElement3.Stroke = System.Drawing.Color.Transparent;
paintElement4.ElementType = Infragistics.UltraChart.Shared.Styles.PaintElementType.Gradient;
paintElement4.Fill = System.Drawing.Color.FromArgb(((int)(((byte)(215)))), ((int)(((byte)(0)))), ((int)(((byte)(5)))));
paintElement4.FillGradientStyle = Infragistics.UltraChart.Shared.Styles.GradientStyle.Horizontal;
paintElement4.FillStopColor = System.Drawing.Color.FromArgb(((int)(((byte)(254)))), ((int)(((byte)(117)))), ((int)(((byte)(16)))));
paintElement4.Stroke = System.Drawing.Color.Transparent;
paintElement5.ElementType = Infragistics.UltraChart.Shared.Styles.PaintElementType.Gradient;
paintElement5.Fill = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(190)))), ((int)(((byte)(2)))));
paintElement5.FillGradientStyle = Infragistics.UltraChart.Shared.Styles.GradientStyle.Horizontal;
paintElement5.FillStopColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(81)))));
paintElement5.Stroke = System.Drawing.Color.Transparent;
paintElement6.ElementType = Infragistics.UltraChart.Shared.Styles.PaintElementType.Gradient;
paintElement6.Fill = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(122)))), ((int)(((byte)(10)))));
paintElement6.FillGradientStyle = Infragistics.UltraChart.Shared.Styles.GradientStyle.Horizontal;
paintElement6.FillStopColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(208)))), ((int)(((byte)(66)))));
paintElement6.Stroke = System.Drawing.Color.Transparent;
this.ultraChart1.ColorModel.Skin.PEs.AddRange(new Infragistics.UltraChart.Resources.Appearance.PaintElement[] {
paintElement2,
paintElement3,
paintElement4,
paintElement5,
paintElement6});
this.ultraChart1.Data.EmptyStyle.LineStyle.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dash;
this.ultraChart1.Data.SwapRowsAndColumns = true;
this.ultraChart1.ForeColor = System.Drawing.SystemColors.ControlText;
this.ultraChart1.Legend.Font = new System.Drawing.Font("Verdana", 7F);
this.ultraChart1.Legend.Location = Infragistics.UltraChart.Shared.Styles.LegendLocation.Top;
this.ultraChart1.Legend.Visible = true;
lineAppearance1.IconAppearance.CharacterFont = new System.Drawing.Font("Microsoft Sans Serif", 12F);
paintElement7.ElementType = Infragistics.UltraChart.Shared.Styles.PaintElementType.None;
lineAppearance1.IconAppearance.PE = paintElement7;
lineAppearance1.Key = "Monday";
paintElement8.ElementType = Infragistics.UltraChart.Shared.Styles.PaintElementType.None;
lineAppearance2.IconAppearance.PE = paintElement8;
lineAppearance2.Key = "Tuesday";
lineAppearance2.LineStyle.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dash;
paintElement9.ElementType = Infragistics.UltraChart.Shared.Styles.PaintElementType.None;
lineAppearance3.IconAppearance.PE = paintElement9;
lineAppearance3.Key = "Wednesday";
lineAppearance3.LineStyle.DrawStyle = Infragistics.UltraChart.Shared.Styles.LineDrawStyle.Dot;
lineChartAppearance1.LineAppearances.Add(lineAppearance1);
lineChartAppearance1.LineAppearances.Add(lineAppearance2);
lineChartAppearance1.LineAppearances.Add(lineAppearance3);
this.ultraChart1.LineChart = lineChartAppearance1;
this.ultraChart1.Name = "ultraChart1";
this.ultraChart1.Tooltips.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F);
this.ultraChart1.Tooltips.HighlightFillColor = System.Drawing.Color.DimGray;
this.ultraChart1.Tooltips.HighlightOutlineColor = System.Drawing.Color.DarkGray;
//
// Form1
//
this.BackColor = System.Drawing.Color.White;
resources.ApplyResources(this, "$this");
this.Controls.Add(this.ultraChart1);
this.Name = "Form1";
this.Load += new System.EventHandler(this.LineChartStyles_Load);
((System.ComponentModel.ISupportInitialize)(this.ultraChart1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private Infragistics.Win.UltraWinChart.UltraChart ultraChart1;
}
}

C# Memory error when resizing window

I have a simple form with some text box, label, and buttons, the problem is that it throws attempted to read or write protected memory every time I resize the window, there are no background tasks or nothing running when the form is showing, there is no code done yet, I just designed the UI and when I resize this error comes up. any ideas as to why this is? like I said, there is no code done yet, just dragged and dropped controls and arranged them.
this is the code in the .Designer
namespace MyProject
{
partial class frmMain
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.dgvMain = new System.Windows.Forms.DataGridView();
this.btnAbout = new System.Windows.Forms.Button();
this.gbFilters = new System.Windows.Forms.GroupBox();
this.cbFiltered = new System.Windows.Forms.ComboBox();
this.cbDomain = new System.Windows.Forms.CheckBox();
this.cbUser = new System.Windows.Forms.CheckBox();
this.btnNewPsswd = new System.Windows.Forms.Button();
this.btnLogOut = new System.Windows.Forms.Button();
this.lblUsr = new System.Windows.Forms.Label();
this.txtUsr = new System.Windows.Forms.TextBox();
this.lblPassword = new System.Windows.Forms.Label();
this.txtPassword = new System.Windows.Forms.TextBox();
this.cbShow = new System.Windows.Forms.CheckBox();
this.lblDomain = new System.Windows.Forms.Label();
this.txtDomain = new System.Windows.Forms.TextBox();
this.lblUrl = new System.Windows.Forms.Label();
this.txtUrl = new System.Windows.Forms.TextBox();
this.lblNotes = new System.Windows.Forms.Label();
this.txtNotes = new System.Windows.Forms.TextBox();
this.btnDelete = new System.Windows.Forms.Button();
this.gbMain = new System.Windows.Forms.GroupBox();
this.btnEdit = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgvMain)).BeginInit();
this.gbFilters.SuspendLayout();
this.gbMain.SuspendLayout();
this.SuspendLayout();
//
// dgvMain
//
this.dgvMain.AllowUserToAddRows = false;
this.dgvMain.AllowUserToDeleteRows = false;
this.dgvMain.BackgroundColor = System.Drawing.Color.White;
this.dgvMain.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.dgvMain.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvMain.GridColor = System.Drawing.Color.White;
this.dgvMain.Location = new System.Drawing.Point(12, 96);
this.dgvMain.Name = "dgvMain";
this.dgvMain.ReadOnly = true;
this.dgvMain.Size = new System.Drawing.Size(544, 331);
this.dgvMain.TabIndex = 1;
//
// btnAbout
//
this.btnAbout.BackColor = System.Drawing.Color.RoyalBlue;
this.btnAbout.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnAbout.ForeColor = System.Drawing.Color.White;
this.btnAbout.Image = global::PasswordSavvy.Properties.Resources.info;
this.btnAbout.Location = new System.Drawing.Point(12, 433);
this.btnAbout.Name = "btnAbout";
this.btnAbout.Size = new System.Drawing.Size(48, 55);
this.btnAbout.TabIndex = 3;
this.btnAbout.UseVisualStyleBackColor = false;
//
// gbFilters
//
this.gbFilters.BackColor = System.Drawing.Color.Transparent;
this.gbFilters.Controls.Add(this.cbFiltered);
this.gbFilters.Controls.Add(this.cbDomain);
this.gbFilters.Controls.Add(this.cbUser);
this.gbFilters.Location = new System.Drawing.Point(12, 13);
this.gbFilters.Name = "gbFilters";
this.gbFilters.Size = new System.Drawing.Size(544, 77);
this.gbFilters.TabIndex = 3;
this.gbFilters.TabStop = false;
this.gbFilters.Text = "Filters";
//
// cbFiltered
//
this.cbFiltered.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cbFiltered.FormattingEnabled = true;
this.cbFiltered.Location = new System.Drawing.Point(243, 21);
this.cbFiltered.Name = "cbFiltered";
this.cbFiltered.Size = new System.Drawing.Size(217, 24);
this.cbFiltered.TabIndex = 2;
//
// cbDomain
//
this.cbDomain.AutoSize = true;
this.cbDomain.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cbDomain.Location = new System.Drawing.Point(106, 44);
this.cbDomain.Name = "cbDomain";
this.cbDomain.Size = new System.Drawing.Size(71, 20);
this.cbDomain.TabIndex = 1;
this.cbDomain.Text = "Domain";
this.cbDomain.UseVisualStyleBackColor = true;
//
// cbUser
//
this.cbUser.AutoSize = true;
this.cbUser.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cbUser.Location = new System.Drawing.Point(106, 18);
this.cbUser.Name = "cbUser";
this.cbUser.Size = new System.Drawing.Size(53, 20);
this.cbUser.TabIndex = 0;
this.cbUser.Text = "User";
this.cbUser.UseVisualStyleBackColor = true;
//
// btnNewPsswd
//
this.btnNewPsswd.BackColor = System.Drawing.Color.SeaGreen;
this.btnNewPsswd.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnNewPsswd.ForeColor = System.Drawing.Color.White;
this.btnNewPsswd.Location = new System.Drawing.Point(314, 433);
this.btnNewPsswd.Name = "btnNewPsswd";
this.btnNewPsswd.Size = new System.Drawing.Size(242, 55);
this.btnNewPsswd.TabIndex = 5;
this.btnNewPsswd.Text = "New Password";
this.btnNewPsswd.UseVisualStyleBackColor = false;
this.btnNewPsswd.Click += new System.EventHandler(this.btnNewPsswd_Click);
//
// btnLogOut
//
this.btnLogOut.BackColor = System.Drawing.Color.RoyalBlue;
this.btnLogOut.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnLogOut.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnLogOut.ForeColor = System.Drawing.Color.White;
this.btnLogOut.Location = new System.Drawing.Point(66, 433);
this.btnLogOut.Name = "btnLogOut";
this.btnLogOut.Size = new System.Drawing.Size(242, 55);
this.btnLogOut.TabIndex = 4;
this.btnLogOut.Text = "Log Out";
this.btnLogOut.UseVisualStyleBackColor = false;
this.btnLogOut.Click += new System.EventHandler(this.btnLogOut_Click);
//
// lblUsr
//
this.lblUsr.AutoSize = true;
this.lblUsr.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.lblUsr.Location = new System.Drawing.Point(14, 25);
this.lblUsr.Margin = new System.Windows.Forms.Padding(3, 6, 3, 3);
this.lblUsr.Name = "lblUsr";
this.lblUsr.Size = new System.Drawing.Size(37, 16);
this.lblUsr.TabIndex = 2;
this.lblUsr.Text = "User";
//
// txtUsr
//
this.txtUsr.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtUsr.Location = new System.Drawing.Point(14, 47);
this.txtUsr.Margin = new System.Windows.Forms.Padding(3, 3, 3, 6);
this.txtUsr.MaxLength = 20;
this.txtUsr.Name = "txtUsr";
this.txtUsr.ReadOnly = true;
this.txtUsr.Size = new System.Drawing.Size(297, 22);
this.txtUsr.TabIndex = 6;
//
// lblPassword
//
this.lblPassword.AutoSize = true;
this.lblPassword.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.lblPassword.Location = new System.Drawing.Point(14, 81);
this.lblPassword.Margin = new System.Windows.Forms.Padding(3, 6, 3, 3);
this.lblPassword.Name = "lblPassword";
this.lblPassword.Size = new System.Drawing.Size(68, 16);
this.lblPassword.TabIndex = 4;
this.lblPassword.Text = "Password";
//
// txtPassword
//
this.txtPassword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtPassword.Location = new System.Drawing.Point(14, 103);
this.txtPassword.Margin = new System.Windows.Forms.Padding(3, 3, 3, 6);
this.txtPassword.MaxLength = 50;
this.txtPassword.Name = "txtPassword";
this.txtPassword.ReadOnly = true;
this.txtPassword.Size = new System.Drawing.Size(297, 22);
this.txtPassword.TabIndex = 7;
this.txtPassword.UseSystemPasswordChar = true;
//
// cbShow
//
this.cbShow.AutoSize = true;
this.cbShow.BackColor = System.Drawing.Color.Transparent;
this.cbShow.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.cbShow.ForeColor = System.Drawing.Color.Goldenrod;
this.cbShow.Location = new System.Drawing.Point(17, 134);
this.cbShow.Name = "cbShow";
this.cbShow.Size = new System.Drawing.Size(60, 20);
this.cbShow.TabIndex = 8;
this.cbShow.Text = "Show ";
this.cbShow.UseVisualStyleBackColor = false;
this.cbShow.CheckStateChanged += new System.EventHandler(this.cbShow_CheckStateChanged);
//
// lblDomain
//
this.lblDomain.AutoSize = true;
this.lblDomain.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.lblDomain.Location = new System.Drawing.Point(14, 163);
this.lblDomain.Margin = new System.Windows.Forms.Padding(3, 6, 3, 3);
this.lblDomain.Name = "lblDomain";
this.lblDomain.Size = new System.Drawing.Size(55, 16);
this.lblDomain.TabIndex = 7;
this.lblDomain.Text = "Domain";
//
// txtDomain
//
this.txtDomain.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtDomain.Location = new System.Drawing.Point(14, 185);
this.txtDomain.Margin = new System.Windows.Forms.Padding(3, 3, 3, 6);
this.txtDomain.MaxLength = 50;
this.txtDomain.Name = "txtDomain";
this.txtDomain.ReadOnly = true;
this.txtDomain.Size = new System.Drawing.Size(297, 22);
this.txtDomain.TabIndex = 9;
//
// lblUrl
//
this.lblUrl.AutoSize = true;
this.lblUrl.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.lblUrl.Location = new System.Drawing.Point(14, 219);
this.lblUrl.Margin = new System.Windows.Forms.Padding(3, 6, 3, 3);
this.lblUrl.Name = "lblUrl";
this.lblUrl.Size = new System.Drawing.Size(35, 16);
this.lblUrl.TabIndex = 9;
this.lblUrl.Text = "URL";
//
// txtUrl
//
this.txtUrl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtUrl.Location = new System.Drawing.Point(14, 241);
this.txtUrl.Margin = new System.Windows.Forms.Padding(3, 3, 3, 6);
this.txtUrl.MaxLength = 255;
this.txtUrl.Name = "txtUrl";
this.txtUrl.ReadOnly = true;
this.txtUrl.Size = new System.Drawing.Size(297, 22);
this.txtUrl.TabIndex = 10;
//
// lblNotes
//
this.lblNotes.AutoSize = true;
this.lblNotes.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.lblNotes.Location = new System.Drawing.Point(14, 275);
this.lblNotes.Margin = new System.Windows.Forms.Padding(3, 6, 3, 3);
this.lblNotes.Name = "lblNotes";
this.lblNotes.Size = new System.Drawing.Size(44, 16);
this.lblNotes.TabIndex = 11;
this.lblNotes.Text = "Notes";
//
// txtNotes
//
this.txtNotes.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.txtNotes.Location = new System.Drawing.Point(14, 297);
this.txtNotes.Margin = new System.Windows.Forms.Padding(3, 3, 3, 6);
this.txtNotes.MaxLength = 255;
this.txtNotes.Multiline = true;
this.txtNotes.Name = "txtNotes";
this.txtNotes.ReadOnly = true;
this.txtNotes.Size = new System.Drawing.Size(297, 126);
this.txtNotes.TabIndex = 11;
//
// btnDelete
//
this.btnDelete.BackColor = System.Drawing.Color.Firebrick;
this.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnDelete.ForeColor = System.Drawing.Color.White;
this.btnDelete.Location = new System.Drawing.Point(202, 432);
this.btnDelete.Name = "btnDelete";
this.btnDelete.Size = new System.Drawing.Size(119, 36);
this.btnDelete.TabIndex = 13;
this.btnDelete.Text = "Delete";
this.btnDelete.UseVisualStyleBackColor = false;
//
// gbMain
//
this.gbMain.BackColor = System.Drawing.Color.Transparent;
this.gbMain.Controls.Add(this.btnEdit);
this.gbMain.Controls.Add(this.btnDelete);
this.gbMain.Controls.Add(this.txtNotes);
this.gbMain.Controls.Add(this.lblNotes);
this.gbMain.Controls.Add(this.txtUrl);
this.gbMain.Controls.Add(this.lblUrl);
this.gbMain.Controls.Add(this.txtDomain);
this.gbMain.Controls.Add(this.lblDomain);
this.gbMain.Controls.Add(this.cbShow);
this.gbMain.Controls.Add(this.txtPassword);
this.gbMain.Controls.Add(this.lblPassword);
this.gbMain.Controls.Add(this.txtUsr);
this.gbMain.Controls.Add(this.lblUsr);
this.gbMain.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.gbMain.Location = new System.Drawing.Point(563, 13);
this.gbMain.Margin = new System.Windows.Forms.Padding(4);
this.gbMain.Name = "gbMain";
this.gbMain.Padding = new System.Windows.Forms.Padding(4);
this.gbMain.Size = new System.Drawing.Size(328, 475);
this.gbMain.TabIndex = 0;
this.gbMain.TabStop = false;
this.gbMain.Text = "groupBox1";
//
// btnEdit
//
this.btnEdit.BackColor = System.Drawing.Color.RoyalBlue;
this.btnEdit.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnEdit.ForeColor = System.Drawing.Color.White;
this.btnEdit.Location = new System.Drawing.Point(77, 432);
this.btnEdit.Name = "btnEdit";
this.btnEdit.Size = new System.Drawing.Size(119, 36);
this.btnEdit.TabIndex = 12;
this.btnEdit.Text = "Edit";
this.btnEdit.UseVisualStyleBackColor = false;
//
// frmMain
//
this.AcceptButton = this.btnNewPsswd;
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnLogOut;
this.ClientSize = new System.Drawing.Size(904, 497);
this.Controls.Add(this.btnLogOut);
this.Controls.Add(this.btnNewPsswd);
this.Controls.Add(this.gbFilters);
this.Controls.Add(this.btnAbout);
this.Controls.Add(this.dgvMain);
this.Controls.Add(this.gbMain);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "frmMain";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Password Savvy";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.frmMain_FormClosed);
this.Load += new System.EventHandler(this.frmMain_Load);
((System.ComponentModel.ISupportInitialize)(this.dgvMain)).EndInit();
this.gbFilters.ResumeLayout(false);
this.gbFilters.PerformLayout();
this.gbMain.ResumeLayout(false);
this.gbMain.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dgvMain;
private System.Windows.Forms.Button btnAbout;
private System.Windows.Forms.GroupBox gbFilters;
private System.Windows.Forms.Button btnNewPsswd;
private System.Windows.Forms.Button btnLogOut;
private System.Windows.Forms.CheckBox cbUser;
private System.Windows.Forms.ComboBox cbFiltered;
private System.Windows.Forms.CheckBox cbDomain;
private System.Windows.Forms.Label lblUsr;
private System.Windows.Forms.TextBox txtUsr;
private System.Windows.Forms.Label lblPassword;
private System.Windows.Forms.TextBox txtPassword;
private System.Windows.Forms.CheckBox cbShow;
private System.Windows.Forms.Label lblDomain;
private System.Windows.Forms.TextBox txtDomain;
private System.Windows.Forms.Label lblUrl;
private System.Windows.Forms.TextBox txtUrl;
private System.Windows.Forms.Label lblNotes;
private System.Windows.Forms.TextBox txtNotes;
private System.Windows.Forms.Button btnDelete;
private System.Windows.Forms.GroupBox gbMain;
private System.Windows.Forms.Button btnEdit;
}
}
all controls in the form are drag and drop
This is almost certainly not a bug in WinForms or your C# code. These errors are caused by either P/Invoke gone wrong or native modules loaded into your process. The native modules could be loaded by you explicitly, or could be the result of AppInit DLLs or DLL's loaded by drivers or other processes.
Enable Managed Debugging Assistants and update your video card drivers. Check Autoruns and the loaded Modules tab of VS for unexpected dlls. Process Explorer is another good tool to identify third party modules.

How can I show labels on sharpmap using PostgreSQL in c#?

VectorLayer v = new VectorLayer("Point", new PostGIS("server=localhost;port=5433;user=postgres;pwd=9839757437;database=OSM3", "GhanaRegions", "Geometry", "id"));
VectorLayer v1 = new VectorLayer("Point", new PostGIS("server=localhost;port=5433;user=postgres;pwd=9839757437;database=OSM3", "ghanalocation", "geometry", "id"));
v.Style.EnableOutline = true;
v.Style.Outline = Pens.Black;
v.Style.Fill = Brushes.Red;
v1.Style.PointColor = Brushes.White;
SharpMap.Layers.LabelLayer layLabel = new SharpMap.Layers.LabelLayer("Name");
layLabel.DataSource = new PostGIS("server=localhost;port=5433;user=postgres;pwd=9839757437;database=OSM3", "citie33", "geometry", "id");
layLabel.Enabled = true;
layLabel.LabelColumn = "Name";
layLabel.MaxVisible = 2;
layLabel.MaxVisible = 190;
layLabel.MinVisible = 130;
layLabel.MultipartGeometryBehaviour = SharpMap.Layers.LabelLayer.MultipartGeometryBehaviourEnum.Largest;
layLabel.LabelFilter = SharpMap.Rendering.LabelCollisionDetection.ThoroughCollisionDetection;
layLabel.PriorityColumn = "id";
layLabel.Style.ForeColor = Color.Beige;
layLabel.Style.Font = new Font(FontFamily.GenericSerif, 12);
layLabel.Style.BackColor = new System.Drawing.SolidBrush(Color.FromArgb(128, 255, 0, 0));
layLabel.Style.HorizontalAlignment = SharpMap.Styles.LabelStyle.HorizontalAlignmentEnum.Center;
// map.Layers.Add(v1);
map.Layers.Add(v);
layLabel.Style.CollisionDetection = true;
map.ZoomToExtents();
pictureBox1.Image = map.GetMap();

How do I make the dateTimePicker not focused when the windows from app opens up?

I have created a windows form app. I want the focus to be in the Business Name textbox. However, when the form opens up, the focus is on the Date Discovered, specifically on 'October'. How do I change the focus to be on Business Name instead of Date Discovered?
Thanks!
this.panBusinessInfo = new System.Windows.Forms.Panel();
this.tbxEmail = new System.Windows.Forms.TextBox();
this.lblEmail = new System.Windows.Forms.Label();
this.tbxPhone = new System.Windows.Forms.TextBox();
this.lblPhone = new System.Windows.Forms.Label();
this.tbxContactPerson = new System.Windows.Forms.TextBox();
this.lblContactPerson = new System.Windows.Forms.Label();
this.tbxWayBackMachURL = new System.Windows.Forms.TextBox();
this.tbxBusinessURL = new System.Windows.Forms.TextBox();
this.tbxZipCode = new System.Windows.Forms.TextBox();
this.cbxState = new System.Windows.Forms.ComboBox();
this.tbxCity = new System.Windows.Forms.TextBox();
this.tbxSuite = new System.Windows.Forms.TextBox();
this.cbxIndustry = new System.Windows.Forms.ComboBox();
this.tbxAddress = new System.Windows.Forms.TextBox();
this.tbxBusinessName = new System.Windows.Forms.TextBox();
this.lblIndustry = new System.Windows.Forms.Label();
this.lblWayBackMachURL = new System.Windows.Forms.Label();
this.lblBusinessURL = new System.Windows.Forms.Label();
this.lblZipCode = new System.Windows.Forms.Label();
this.lblState = new System.Windows.Forms.Label();
this.lblCity = new System.Windows.Forms.Label();
this.lblSuite = new System.Windows.Forms.Label();
this.lblAddress = new System.Windows.Forms.Label();
this.lblBusinessName = new System.Windows.Forms.Label();
this.pnDates = new System.Windows.Forms.Panel();
this.dtpProjFinish = new System.Windows.Forms.DateTimePicker();
this.dtpProjStart = new System.Windows.Forms.DateTimePicker();
this.dtpDateDisc = new System.Windows.Forms.DateTimePicker();
this.lblProjFinishDate = new System.Windows.Forms.Label();
this.lblProjStartDate = new System.Windows.Forms.Label();
this.lblDateDiscovered = new System.Windows.Forms.Label();
this.pnTerms = new System.Windows.Forms.Panel();
this.btnCalculate = new System.Windows.Forms.Button();
this.lblTMCost = new System.Windows.Forms.Label();
this.lblTotMaint = new System.Windows.Forms.Label();
this.lblSBCost = new System.Windows.Forms.Label();
this.lblSiteBuildCost = new System.Windows.Forms.Label();
this.chbxMaintOnly = new System.Windows.Forms.CheckBox();
this.chbxBuildOut = new System.Windows.Forms.CheckBox();
this.lblMaintOnly = new System.Windows.Forms.Label();
this.lblMaintenacneFeeOnly = new System.Windows.Forms.Label();
this.lblGTotal = new System.Windows.Forms.Label();
this.lblGrandTotal = new System.Windows.Forms.Label();
this.lblMonthlyPaymentCalc = new System.Windows.Forms.Label();
this.lblMonthlyPayment = new System.Windows.Forms.Label();
this.tbxNumMonths = new System.Windows.Forms.TextBox();
this.lblNumMonths = new System.Windows.Forms.Label();
this.tbxMaintFee = new System.Windows.Forms.TextBox();
this.lblMaintenanceFee = new System.Windows.Forms.Label();
this.tbxSBCost = new System.Windows.Forms.TextBox();
this.lblTotContract = new System.Windows.Forms.Label();
this.chbxPayments = new System.Windows.Forms.CheckBox();
this.chbxFull = new System.Windows.Forms.CheckBox();
this.lblTerms = new System.Windows.Forms.Label();
this.pnNotes = new System.Windows.Forms.Panel();
this.tbxNotes = new System.Windows.Forms.TextBox();
this.lblNotesReq = new System.Windows.Forms.Label();
this.pnButtons = new System.Windows.Forms.Panel();
this.btnEmail = new System.Windows.Forms.Button();
this.btnCreatePDF = new System.Windows.Forms.Button();
this.btnSave = new System.Windows.Forms.Button();
this.btnClear = new System.Windows.Forms.Button();
this.btnClose = new System.Windows.Forms.Button();
this.panBusinessInfo.SuspendLayout();
this.pnDates.SuspendLayout();
this.pnTerms.SuspendLayout();
this.pnNotes.SuspendLayout();
this.pnButtons.SuspendLayout();
this.SuspendLayout();
//
// panBusinessInfo
//
this.panBusinessInfo.Controls.Add(this.tbxEmail);
this.panBusinessInfo.Controls.Add(this.lblEmail);
this.panBusinessInfo.Controls.Add(this.tbxPhone);
this.panBusinessInfo.Controls.Add(this.lblPhone);
this.panBusinessInfo.Controls.Add(this.tbxContactPerson);
this.panBusinessInfo.Controls.Add(this.lblContactPerson);
this.panBusinessInfo.Controls.Add(this.tbxWayBackMachURL);
this.panBusinessInfo.Controls.Add(this.tbxBusinessURL);
this.panBusinessInfo.Controls.Add(this.tbxZipCode);
this.panBusinessInfo.Controls.Add(this.cbxState);
this.panBusinessInfo.Controls.Add(this.tbxCity);
this.panBusinessInfo.Controls.Add(this.tbxSuite);
this.panBusinessInfo.Controls.Add(this.cbxIndustry);
this.panBusinessInfo.Controls.Add(this.tbxAddress);
this.panBusinessInfo.Controls.Add(this.tbxBusinessName);
this.panBusinessInfo.Controls.Add(this.lblIndustry);
this.panBusinessInfo.Controls.Add(this.lblWayBackMachURL);
this.panBusinessInfo.Controls.Add(this.lblBusinessURL);
this.panBusinessInfo.Controls.Add(this.lblZipCode);
this.panBusinessInfo.Controls.Add(this.lblState);
this.panBusinessInfo.Controls.Add(this.lblCity);
this.panBusinessInfo.Controls.Add(this.lblSuite);
this.panBusinessInfo.Controls.Add(this.lblAddress);
this.panBusinessInfo.Controls.Add(this.lblBusinessName);
this.panBusinessInfo.Location = new System.Drawing.Point(8, 8);
this.panBusinessInfo.Name = "panBusinessInfo";
this.panBusinessInfo.Size = new System.Drawing.Size(305, 286);
this.panBusinessInfo.TabIndex = 0;
//
// tbxEmail
//
this.tbxEmail.Location = new System.Drawing.Point(150, 135);
this.tbxEmail.Name = "tbxEmail";
this.tbxEmail.Size = new System.Drawing.Size(148, 20);
this.tbxEmail.TabIndex = 9;
//
// lblEmail
//
this.lblEmail.AutoSize = true;
this.lblEmail.Location = new System.Drawing.Point(150, 119);
this.lblEmail.Name = "lblEmail";
this.lblEmail.Size = new System.Drawing.Size(35, 13);
this.lblEmail.TabIndex = 999;
this.lblEmail.Text = "Email:";
//
// tbxPhone
//
this.tbxPhone.Location = new System.Drawing.Point(6, 135);
this.tbxPhone.Name = "tbxPhone";
this.tbxPhone.Size = new System.Drawing.Size(138, 20);
this.tbxPhone.TabIndex = 8;
//
// lblPhone
//
this.lblPhone.AutoSize = true;
this.lblPhone.Location = new System.Drawing.Point(3, 119);
this.lblPhone.Name = "lblPhone";
this.lblPhone.Size = new System.Drawing.Size(41, 13);
this.lblPhone.TabIndex = 999;
this.lblPhone.Text = "Phone:";
//
// tbxContactPerson
//
this.tbxContactPerson.Location = new System.Drawing.Point(6, 250);
this.tbxContactPerson.Name = "tbxContactPerson";
this.tbxContactPerson.Size = new System.Drawing.Size(292, 20);
this.tbxContactPerson.TabIndex = 12;
//
// lblContactPerson
//
this.lblContactPerson.AutoSize = true;
this.lblContactPerson.Location = new System.Drawing.Point(3, 234);
this.lblContactPerson.Name = "lblContactPerson";
this.lblContactPerson.Size = new System.Drawing.Size(83, 13);
this.lblContactPerson.TabIndex = 999;
this.lblContactPerson.Text = "Contact Person:";
//
// tbxWayBackMachURL
//
this.tbxWayBackMachURL.Location = new System.Drawing.Point(6, 212);
this.tbxWayBackMachURL.Name = "tbxWayBackMachURL";
this.tbxWayBackMachURL.Size = new System.Drawing.Size(292, 20);
this.tbxWayBackMachURL.TabIndex = 11;
//
// tbxBusinessURL
//
this.tbxBusinessURL.Location = new System.Drawing.Point(6, 173);
this.tbxBusinessURL.Name = "tbxBusinessURL";
this.tbxBusinessURL.Size = new System.Drawing.Size(292, 20);
this.tbxBusinessURL.TabIndex = 10;
//
// tbxZipCode
//
this.tbxZipCode.Location = new System.Drawing.Point(214, 97);
this.tbxZipCode.Name = "tbxZipCode";
this.tbxZipCode.Size = new System.Drawing.Size(84, 20);
this.tbxZipCode.TabIndex = 7;
//
// cbxState
//
this.cbxState.FormattingEnabled = true;
this.cbxState.Items.AddRange(new object[] {
"AL",
"AK",
"AZ",
"AR",
"CA",
"CO",
"CT",
"DE",
"FL",
"GA",
"HI",
"ID",
"IL",
"IN",
"IA",
"KS",
"KY",
"LA",
"ME",
"MD",
"MA",
"MI",
"MN",
"MS",
"MO",
"MT",
"NE",
"NV",
"NH",
"NJ",
"NM",
"NY",
"NC",
"ND",
"OH",
"OK",
"OR",
"PA",
"RI",
"SC",
"SD",
"TN",
"TX",
"UT",
"VT",
"VA",
"WA",
"WV",
"WI",
"WY"});
this.cbxState.Location = new System.Drawing.Point(150, 97);
this.cbxState.Name = "cbxState";
this.cbxState.Size = new System.Drawing.Size(57, 21);
this.cbxState.TabIndex = 6;
//
// tbxCity
//
this.tbxCity.Location = new System.Drawing.Point(6, 97);
this.tbxCity.Name = "tbxCity";
this.tbxCity.Size = new System.Drawing.Size(138, 20);
this.tbxCity.TabIndex = 5;
//
// tbxSuite
//
this.tbxSuite.Location = new System.Drawing.Point(150, 59);
this.tbxSuite.Name = "tbxSuite";
this.tbxSuite.Size = new System.Drawing.Size(100, 20);
this.tbxSuite.TabIndex = 4;
//
// cbxIndustry
//
this.cbxIndustry.FormattingEnabled = true;
this.cbxIndustry.Items.AddRange(new object[] {
"Alteration Shop",
"Art Gallery",
"Retail-Clothes/Shoes",
"Retail-Hair and Beauty",
"Retail-Other",
"Services-Dry Cleaning",
"Services-Food",
"Services-Other",
"Other"});
this.cbxIndustry.Location = new System.Drawing.Point(150, 19);
this.cbxIndustry.Name = "cbxIndustry";
this.cbxIndustry.Size = new System.Drawing.Size(121, 21);
this.cbxIndustry.TabIndex = 2;
//
// tbxAddress
//
this.tbxAddress.Location = new System.Drawing.Point(6, 59);
this.tbxAddress.Name = "tbxAddress";
this.tbxAddress.Size = new System.Drawing.Size(138, 20);
this.tbxAddress.TabIndex = 3;
//
// tbxBusinessName
//
this.tbxBusinessName.Location = new System.Drawing.Point(6, 19);
this.tbxBusinessName.Name = "tbxBusinessName";
this.tbxBusinessName.Size = new System.Drawing.Size(138, 20);
this.tbxBusinessName.TabIndex = 1;
//
// lblIndustry
//
this.lblIndustry.AutoSize = true;
this.lblIndustry.Location = new System.Drawing.Point(147, 3);
this.lblIndustry.Name = "lblIndustry";
this.lblIndustry.Size = new System.Drawing.Size(47, 13);
this.lblIndustry.TabIndex = 999;
this.lblIndustry.Text = "Industry:";
//
// lblWayBackMachURL
//
this.lblWayBackMachURL.AutoSize = true;
this.lblWayBackMachURL.Location = new System.Drawing.Point(3, 195);
this.lblWayBackMachURL.Name = "lblWayBackMachURL";
this.lblWayBackMachURL.Size = new System.Drawing.Size(126, 13);
this.lblWayBackMachURL.TabIndex = 999;
this.lblWayBackMachURL.Text = "WayBack Machine URL:";
//
// lblBusinessURL
//
this.lblBusinessURL.AutoSize = true;
this.lblBusinessURL.Location = new System.Drawing.Point(3, 157);
this.lblBusinessURL.Name = "lblBusinessURL";
this.lblBusinessURL.Size = new System.Drawing.Size(77, 13);
this.lblBusinessURL.TabIndex = 999;
this.lblBusinessURL.Text = "Business URL:";
//
// lblZipCode
//
this.lblZipCode.AutoSize = true;
this.lblZipCode.Location = new System.Drawing.Point(211, 81);
this.lblZipCode.Name = "lblZipCode";
this.lblZipCode.Size = new System.Drawing.Size(53, 13);
this.lblZipCode.TabIndex = 999;
this.lblZipCode.Text = "Zip Code:";
//
// lblState
//
this.lblState.AutoSize = true;
this.lblState.Location = new System.Drawing.Point(147, 81);
this.lblState.Name = "lblState";
this.lblState.Size = new System.Drawing.Size(35, 13);
this.lblState.TabIndex = 999;
this.lblState.Text = "State:";
//
// lblCity
//
this.lblCity.AutoSize = true;
this.lblCity.Location = new System.Drawing.Point(3, 81);
this.lblCity.Name = "lblCity";
this.lblCity.Size = new System.Drawing.Size(27, 13);
this.lblCity.TabIndex = 999;
this.lblCity.Text = "City:";
//
// lblSuite
//
this.lblSuite.AutoSize = true;
this.lblSuite.Location = new System.Drawing.Point(147, 42);
this.lblSuite.Name = "lblSuite";
this.lblSuite.Size = new System.Drawing.Size(34, 13);
this.lblSuite.TabIndex = 999;
this.lblSuite.Text = "Suite:";
//
// lblAddress
//
this.lblAddress.AutoSize = true;
this.lblAddress.Location = new System.Drawing.Point(3, 42);
this.lblAddress.Name = "lblAddress";
this.lblAddress.Size = new System.Drawing.Size(48, 13);
this.lblAddress.TabIndex = 999;
this.lblAddress.Text = "Address:";
//
// lblBusinessName
//
this.lblBusinessName.AutoSize = true;
this.lblBusinessName.Location = new System.Drawing.Point(3, 3);
this.lblBusinessName.Name = "lblBusinessName";
this.lblBusinessName.Size = new System.Drawing.Size(83, 13);
this.lblBusinessName.TabIndex = 999;
this.lblBusinessName.Text = "Business Name:";
//
// pnDates
//
this.pnDates.Controls.Add(this.dtpProjFinish);
this.pnDates.Controls.Add(this.dtpProjStart);
this.pnDates.Controls.Add(this.dtpDateDisc);
this.pnDates.Controls.Add(this.lblProjFinishDate);
this.pnDates.Controls.Add(this.lblProjStartDate);
this.pnDates.Controls.Add(this.lblDateDiscovered);
this.pnDates.Location = new System.Drawing.Point(319, 8);
this.pnDates.Name = "pnDates";
this.pnDates.Size = new System.Drawing.Size(232, 124);
this.pnDates.TabIndex = 0;
//
// dtpProjFinish
//
this.dtpProjFinish.Location = new System.Drawing.Point(6, 97);
this.dtpProjFinish.Name = "dtpProjFinish";
this.dtpProjFinish.Size = new System.Drawing.Size(218, 20);
this.dtpProjFinish.TabIndex = 15;
//
// dtpProjStart
//
this.dtpProjStart.Location = new System.Drawing.Point(6, 59);
this.dtpProjStart.Name = "dtpProjStart";
this.dtpProjStart.Size = new System.Drawing.Size(218, 20);
this.dtpProjStart.TabIndex = 14;
//
// dtpDateDisc
//
this.dtpDateDisc.Location = new System.Drawing.Point(6, 19);
this.dtpDateDisc.Name = "dtpDateDisc";
this.dtpDateDisc.Size = new System.Drawing.Size(218, 20);
this.dtpDateDisc.TabIndex = 13;
//
// lblProjFinishDate
//
this.lblProjFinishDate.AutoSize = true;
this.lblProjFinishDate.Location = new System.Drawing.Point(3, 81);
this.lblProjFinishDate.Name = "lblProjFinishDate";
this.lblProjFinishDate.Size = new System.Drawing.Size(111, 13);
this.lblProjFinishDate.TabIndex = 999;
this.lblProjFinishDate.Text = "Projected Finish Date:";
//
// lblProjStartDate
//
this.lblProjStartDate.AutoSize = true;
this.lblProjStartDate.Location = new System.Drawing.Point(3, 42);
this.lblProjStartDate.Name = "lblProjStartDate";
this.lblProjStartDate.Size = new System.Drawing.Size(106, 13);
this.lblProjStartDate.TabIndex = 999;
this.lblProjStartDate.Text = "Projected Start Date:";
//
// lblDateDiscovered
//
this.lblDateDiscovered.AutoSize = true;
this.lblDateDiscovered.Location = new System.Drawing.Point(3, 3);
this.lblDateDiscovered.Name = "lblDateDiscovered";
this.lblDateDiscovered.Size = new System.Drawing.Size(90, 13);
this.lblDateDiscovered.TabIndex = 999;
this.lblDateDiscovered.Text = "Date Discovered:";
You can simply put this code in Load event of form:
this.ActiveControl= this.tbxBusinessName;
or
this.tbxBusinessName.Select();
or
this.Visible = true;
this.tbxBusinessName.Focus();
All above code will do the trick for you.
But why this.tbxBusinessName.TabIndex = 0; didn't work?
Because you have multiple controls with TabIndex = 0 and in this situations the z-order of controls will check and the control which is on top will win and gain focus first.
For more information you can see How to: Set the Tab Order on Windows Forms.
And Why simply this.tbxBusinessName.Focus(); Didn't work?
because you can use the Control.Focus method in the Load event of the form to set the focus on a control only after the Visible property of the form is set to true. You can set this.Visible = true; or call this.Show();
You could manually set the focus by creating an OnLoad function for the window. Or do as Lars suggested, set the lowest tabIndex on the object you want to have focus.

Categories