Hi all,
INTRO
My first post here so ill just give a brief intro and appology for this informal post.
I'm a junior programmer and keen to learn, from Australia, 18yrs old.
Problem
ok so to the problem i've got.
I want my application to be able to be changed by the user.
For example on my form I have the labels Blue, Red and Green but the user requires yellow and another colour which is unkown to me so they would have an ADD function which saves to the database so next time they login their colours are there as labels.
How would you pick up the name of the colour from the database? and place that into your code to create a dynamic control with the same name as the colour which is unkown?
Is there a way of changing a variable name?
I went about it this way but am getting stuck:
So if there is any better or other way that works please and thank you.Code:Dim SQL As String SQL = "select * from Colours where type ='control' " Dim dt As DataTable = DAC.ExecuteQuery(SQL) Dim dr As DataRow Dim i As Integer = 0 Dim controlName As System.Windows.Forms.Label() While i < dt.Rows.Count dr = dt.Rows(i) controlName = dr("Name") '' I want controlName to be changed i = i + 1 End While
Cheers




Reply With Quote
