Click here to Skip to main content
15,915,869 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to set 100 checkbox enable property according to values in a textfile ? Pin
anpm14-Jun-07 3:36
anpm14-Jun-07 3:36 
GeneralRe: How to set 100 checkbox enable property according to values in a textfile ? Pin
reegan4114-Jun-07 4:19
reegan4114-Jun-07 4:19 
GeneralRe: How to set 100 checkbox enable property according to values in a textfile ? Pin
anpm14-Jun-07 4:28
anpm14-Jun-07 4:28 
AnswerRe: How to set 100 checkbox enable property according to values in a textfile ? Pin
reegan4114-Jun-07 6:50
reegan4114-Jun-07 6:50 
QuestionRe: How to set 100 checkbox enable property according to values in a textfile ? Pin
anpm14-Jun-07 14:03
anpm14-Jun-07 14:03 
AnswerRe: How to set 100 checkbox enable property according to values in a textfile ? Pin
Benjamin Liedblad14-Jun-07 16:49
Benjamin Liedblad14-Jun-07 16:49 
GeneralRe: How to set 100 checkbox enable property according to values in a textfile ? Pin
anpm15-Jun-07 16:37
anpm15-Jun-07 16:37 
AnswerRe: How to set 100 checkbox enable property according to values in a textfile ? Pin
Tom Deketelaere14-Jun-07 21:44
professionalTom Deketelaere14-Jun-07 21:44 
first you would have to read the text file
and for every line in the text file (wich I assumse corrisponds with the letter (line1=A, line2=B)) you dynamicly enable or disable the checkbox

this is how I did it (made a little example but can't attach it here so just the code then)
its only for 2 rows but should work fine for how many you want
(remember I made it in 5 min so there are things that could be better)

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
        Dim fs As New System.IO.StreamReader("C:\Documents and Settings\Tom\Mijn documenten\test.txt")<br />
        Dim rows As New List(Of String)<br />
        rows.Add("A")<br />
        rows.Add("B")<br />
        Dim row As Integer = 0<br />
        Do While Not fs.EndOfStream<br />
            Dim s() As String = fs.ReadLine.Split(";")<br />
            Dim column As Integer = 1<br />
            Do While column < s.Length + 1<br />
                enabledisableseat(rows.Item(row), column, IIf(s(column - 1).Equals("T"), True, False))<br />
                column += 1<br />
            Loop<br />
            row += 1<br />
        Loop<br />
    End Sub<br />
<br />
    Private Sub enabledisableseat(ByVal row As String, ByVal column As Integer, ByVal enable As Boolean)<br />
        For Each c As Control In Me.Controls<br />
            If c.GetType.Equals(GetType(CheckBox)) Then<br />
                Dim chk As CheckBox = c<br />
                If chk.Name.Equals(row & column) Then<br />
                    chk.Enabled = enable<br />
                End If<br />
            End If<br />
        Next<br />
    End Sub


I hope this helps you on your way
QuestionImport Csv file to Access Pin
Vimalsoft(Pty) Ltd14-Jun-07 2:06
professionalVimalsoft(Pty) Ltd14-Jun-07 2:06 
AnswerRe: Import Csv file to Access Pin
Dave Kreskowiak14-Jun-07 5:45
mveDave Kreskowiak14-Jun-07 5:45 
GeneralRe: Import Csv file to Access Pin
Vimalsoft(Pty) Ltd14-Jun-07 21:38
professionalVimalsoft(Pty) Ltd14-Jun-07 21:38 
QuestionFlexgrid how to enable scrollbars Pin
kankeyan14-Jun-07 2:02
kankeyan14-Jun-07 2:02 
AnswerRe: Flexgrid how to enable scrollbars Pin
Dave Kreskowiak14-Jun-07 5:28
mveDave Kreskowiak14-Jun-07 5:28 
QuestionVB.Net 2005 Questions Pin
Central_IT14-Jun-07 1:41
Central_IT14-Jun-07 1:41 
AnswerRe: VB.Net 2005 Questions Pin
Dave Kreskowiak14-Jun-07 5:27
mveDave Kreskowiak14-Jun-07 5:27 
Questionbuilt video movie maker in vb.NET application Pin
cheerup_woe14-Jun-07 0:20
cheerup_woe14-Jun-07 0:20 
AnswerRe: built video movie maker in vb.NET application Pin
Steven J Jowett14-Jun-07 5:14
Steven J Jowett14-Jun-07 5:14 
QuestionCannot delete file because it is in use by another process Pin
Tom Deketelaere13-Jun-07 23:36
professionalTom Deketelaere13-Jun-07 23:36 
AnswerRe: Cannot delete file because it is in use by another process Pin
Colin Angus Mackay13-Jun-07 23:41
Colin Angus Mackay13-Jun-07 23:41 
GeneralRe: Cannot delete file because it is in use by another process Pin
Tom Deketelaere13-Jun-07 23:48
professionalTom Deketelaere13-Jun-07 23:48 
GeneralRe: Cannot delete file because it is in use by another process Pin
Colin Angus Mackay13-Jun-07 23:58
Colin Angus Mackay13-Jun-07 23:58 
GeneralRe: Cannot delete file because it is in use by another process Pin
Tom Deketelaere14-Jun-07 0:02
professionalTom Deketelaere14-Jun-07 0:02 
GeneralRe: Cannot delete file because it is in use by another process Pin
Colin Angus Mackay14-Jun-07 0:42
Colin Angus Mackay14-Jun-07 0:42 
GeneralRe: Cannot delete file because it is in use by another process Pin
Tom Deketelaere14-Jun-07 1:37
professionalTom Deketelaere14-Jun-07 1:37 
GeneralRe: Cannot delete file because it is in use by another process Pin
Dave Kreskowiak14-Jun-07 5:23
mveDave Kreskowiak14-Jun-07 5:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.