CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Dec 2002
    Location
    NC
    Posts
    125

    An easier if esle if (Resolved!!)

    OK VBers, There has got to be an easier way to perform all these if statements. This is just the tab letter A and B, there is 24 more!

    Code:
    dim tabstrip as string
    tabstrip = sstab1.caption
    
    If tabstrip = "A" Then
    Data1.Visible = True
    Data2.Visible = False
    Data3.Visible = False
    Data4.Visible = False
    Data5.Visible = False
    Data6.Visible = False
    Data7.Visible = False
    Data8.Visible = False
    Data9.Visible = False
    Data10.Visible = False
    Data11.Visible = False
    Data12.Visible = False
    Data13.Visible = False
    Data14.Visible = False
    Data15.Visible = False
    
    ElseIf tabstrip = "B" Then
    Data1.Visible = False
    Data2.Visible = True
    Data3.Visible = False
    Data4.Visible = False
    Data5.Visible = False
    Data6.Visible = False
    Data7.Visible = False
    Data8.Visible = False
    Data9.Visible = False
    Data10.Visible = False
    Data11.Visible = False
    Data12.Visible = False
    Data13.Visible = False
    Data14.Visible = False
    Data15.Visible = False
    I thought something like this would work but it didn't.
    Code:
    dim counter as integer
    counter = 1
    
    if tabstrip = "A" then	
    
    	do
    		data & counter.visible = false
    		counter = counter + 1
    	loop until counter = 15
    data1.visible = true 
    
    end if
    Can someone see the problem or give me a better solution?
    Last edited by dedub; January 12th, 2003 at 08:58 PM.
    R.L.T.W. A+, NET+, CCNA

    doin' my best

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured