Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>According to the exception </p> <pre><code>Constructor on type 'System.Windows.Forms.ToolStripControlHost' not found. </code></pre> <p>I found some information on the MSDN Forum.</p> <p>This happends because the <code>ToolStripControlHost</code> class does not have a constructor with no parameter. </p> <p>To solve this problem, you can create your own ToolStripControlHost with a none-parameter constructor and make the ToolStripMaskedTextBox inherited from your ToolStripControlHost. Try something like the following</p> <pre><code>//Declare a class that inherits from ToolStripControlHost. [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.ToolStrip | ToolStripItemDesignerAvailability.StatusStrip)] public class ToolStripMaskedTextBox : MyCustomToolStripControlHost { // Call the base constructor passing in a MaskedTextBox instance. public ToolStripMaskedTextBox() : base(CreateControlInstance()) { } public MaskedTextBox MaskedTextBox { get { return Control as MaskedTextBox; } } private static Control CreateControlInstance() { MaskedTextBox mtb = new MaskedTextBox(); mtb.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; mtb.MinimumSize = new System.Drawing.Size(100, 16); mtb.PasswordChar = '*'; return mtb; } } public class MyCustomToolStripControlHost : ToolStripControlHost { public MyCustomToolStripControlHost() : base(new Control()) { } public MyCustomToolStripControlHost(Control c) : base(c) { } } </code></pre> <h3>This will fix the problem with your exception.</h3> <p>The Problem with the Forms Designer (ToolStripMaskedTextBox is not visible after running the app) is not solved but you can close the designer and open the file again. </p> <p>Then you can go on without any problems.</p> <p><strong>Hope this helps</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload