visual studio - Show Control.Text in VisualStudio Designer -


I am using VisualStudio 2005 and I want to set the control text of a form. For various reasons this visual should not be done in the studio designer. I can write the code as follows:

  Public Form 1 () {InitializeComponent (); Button 1 Text = "test"; }  

But now I do not see the text in the designer, the button is empty (or the default text of "button1") is there a way to set the control text outside the designer and Can I see the text in Visual Studio Designer? The text should not be editable, it should be visible only. It would be really good, because it will be possible to use constants for frequently used phrases and still they will appear in the designer to adjust the UI. This is a bit of a hack, but you can sub-class the desired control and override the text property:

  public class MyTest: buttons {public override string text {get {return @" test "; } Set {}}}  

It appears in the designer, but when you try and change it, then Visual Studio ignores you only, you may return a hardcode string Want to do something other than that, but I'm sure you get this idea: -)


Comments