AdvancedHMI Software
General Category => Support Questions => Topic started by: Phrog30 on August 18, 2017, 04:07:11 PM
-
On the basicbutton, the text property allows multi line entry. There is a drop that makes it simple. Is it possible to add this feature to the textalternate property?
James
-
Edit BasicButton.vb and tell Visual Studio that you want to use a multiline editor for the property by applying an attribute to the property like this:
<System.ComponentModel.Editor(GetType(System.ComponentModel.Design.MultilineStringEditor), GetType(System.Drawing.Design.UITypeEditor))> _
Public Property TextAlternate() As String
-
Awesome, thank you!!
-
I couldn't get your snippet to work, I ended up with this...
<EditorAttribute("System.ComponentModel.Design.MultilineStringEditor, System.Design", "System.Drawing.Design.UITypeEditor")>
Public Property TextAlternate() As String
I'm guessing I was missing a reference to something, but couldn't figure out what. Your post helped me Google what I needed, thanks.
James
-
Were you getting an error from the code I posted? I tried it out and it worked for me. One thing I did notice about VS2017 is that when you make a change to a control, just building the solution is not enough. If you have the form open, you must close it and re-open for it to take the changes in the designer.
-
I get an error in designer, says Type "System.ComponentModel.Design.MultilineStringEditor" is not defined.
-
I see what it is. I had a reference to System.Design in the project I tried it on.
-
Simple enough, I thought I tried adding that. According to the site I got the snippet I used, you don't need to reference anything.