Question
January 16, 2009 at 05:47 AM
demosthanese

VB.net Array/logic question

by demosthanese . Updated 17 years, 7 months ago

I’m making a little app for work and I’m really new to programming so forgive me if this is a newbish question.

What I’m trying to do is skim through an array and use its values to provide control names. See the code…

[code]
Dim UtilityGroups() As String = {“Electric”, “Gas”, “Irrigation”, “Lighting”, “Water”}
Dim group As String

For Each group In UtilityGroups
If group & “FlagCheck.Checked” = True Then
Select Case group & “GroupBox.ForeColor”
Case group & “GroupBox.ForeColor” = Color.Black
group & “GroupBox.ForeColor” = Color.Yellow
Case group & “GroupBox.ForeColor” = Color.Yellow
group & “GroupBox.ForeColor” = Color.red
Case group & “GroupBox.ForeColor” = Color.Red
MessageBox.Show(group & ” has already been escalated to red.”)
End Select
End If
Next
[/code]

I know im a newb, but this seems like it should would. It works when i do something like:

[code] messagebox.show(group) [/code]

but not within a statement. Where am I going wrong?

This discussion is locked

All Comments