Greetings.
I wish to name the items in a contex menu strip dynamicaly.
Im unsure how to explain the problem but ill show my code and hopefully those of you with deep VB know wots will see my problem.
THIS IS MY CURRENT CODE: Menu item 1 and 2 are reading the name from an array of names and those names are being assigned to each Menu item in turn.
VB Code:
Private Sub trayMenuItems() Dim len As Integer Dim i As Integer Dim s As String len = (AStatus.Count) - 1 For i = 0 To len s = AStatus(i) Next MenuItem1.Text = AStatus(0) MenuItem2.Text = AStatus(1) End Sub
THIS IS WHAT I WANT TO DO:
The bold is what im attempting to do. THe code there is wrong and does not work. The problem is im not sure i can do waht i want to do because im actualy trying to place a variable in an objects name...sorry i cant be more descriptive.. (read VB novice)??VB Code:
Private Sub trayMenuItems() Dim len As Integer Dim i As Integer Dim s As String len = (AStatus.Count) - 1 For i = 0 To len s = AStatus(i) [B]MenuItem & i +1 & .Text = AStatus(i)[/B] Next End Sub


Reply With Quote
