Hello,
I create a new control based on ButtonEdit control:
public partial class MySearchTextbox : ButtonEdit
{
public MySearchTextbox()
{
InitializeComponent();
this.Font = new System.Drawing.Font("Segoe UI", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.Margin = new System.Windows.Forms.Padding(3, 3, 3, 6);
this.UseVisualStyle = true;
this.ButtonStyle = Syncfusion.Windows.Forms.ButtonAppearance.Metro;
}
protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
}
protected override void OnCreateControl()
{
base.OnCreateControl();
TextBoxExt txtSearch;
ButtonEditChildButton btnClear;
ButtonEditChildButton btnPrev;
ButtonEditChildButton btnNext;
txtSearch = new TextBoxExt();
btnClear = new ButtonEditChildButton();
btnPrev = new ButtonEditChildButton();
btnNext = new ButtonEditChildButton();
//Embedding text in TextBox
this.TextBox = txtSearch;
this.Controls.Add(txtSearch);
//Aligning the child button
btnClear.ButtonAlign = ButtonAlignment.Right;
btnPrev.ButtonAlign = ButtonAlignment.Right;
btnNext.ButtonAlign = ButtonAlignment.Right;
//Setting text for child buttons
btnClear.Text = "X";
btnPrev.Text = "<";
btnNext.Text = ">";
btnClear.Size = new(20, 20);
btnPrev.Size = new(20, 20);
btnNext.Size = new(20, 20);
//Adding child buttons
this.Buttons.Add(btnClear);
this.Buttons.Add(btnPrev);
this.Buttons.Add(btnNext);
}
}
I rebuild the above code, I place the MySearchTextbox on a form. This works well.
Now, when I change anything in the above code and rebuild the project, I cannot open the previous form again in designer:
Can you help me please how can I avoid this exception?
Thank you!
BR, SZL
Hi SZL,
Sorry for the delay in getting back to you.
Regards,
Gokul T
Hello,
In my case after the second rebuild was wrong. I think there are some problem with this control but its not to easy detect the reason. I try add the button from code instead of designer. In this case at runtime the top of my form starts vibrating. I debug and seems it depends on multiple thing (the Margin settings, when I set the textbox placeholder the vibration appear).
For this reason I created my own usercontrol for my requirements.
Unfortunatelly currently I have no extra time to deep-debug this behavior on this control. Probably at later time.
From my side we can close this topic.
Thank you for help!
BR, SZL
Hi SZL,
Thanks for the update. Please let us know if you have any other queries. We will be glad to assist you.
Regards,
Bagavathi Perumal A