The scenario is this: I want to set the formborderstyle using a combobox.
I can set the borderstyle to "None" successfully with these methods:
Form1.FormBorderStyle = 0
Or
Form1.FormBorderStyle = Windows.Forms.FormBorderStyle.None
How could I do this with a string?
Dim formstyle As String
formstyle = "Windows.Forms.FormBorderStyle." & ComboBox1.Text
Form1.FormBorderStyle = formstyle
I get this error: Conversion from string "Windows.Forms.FormBorderStyle.No" to type 'Integer' is not valid.
It seems like Form1.formborderstyle only takes integers. Without actually using the integers, is there a way i can convert the string to the integer counterpart...sort of like an eval?
Ultimately I was hoping it looked something like:
Dim formstyle As String
formstyle = "Windows.Forms.FormBorderStyle." & ComboBox1.Text
Form1.FormBorderStyle = eval(formstyle)