coba pake fungsi ini

Public Function visibleTrue(f As Form)
    For Each X In f.Controls
    If (TypeOf X Is TextBox) or (TypeOf X Is Label)  Then
        X.visible = true
    End If
    Next
End Function

salam

Den Aly



                                                                                
                                                        
                      "Ardhi Adhary                                             
                                                        
                      Arbain"                    To:      
[email protected]                                                 
                      <[EMAIL PROTECTED]         cc:                            
                                                        
                      m>                         Subject: [Programmer-VB] 
Mempersingkat proses untuk puluhan objek                      
                      Sent by:                                                  
                                                        
                      [EMAIL PROTECTED]                                         
                                                       
                      ogroups.com                                               
                                                        
                                                                                
                                                        
                                                                                
                                                        
                      03/06/2006 10:50                                          
                                                        
                      AM                                                        
                                                        
                      Please respond to                                         
                                                        
                      Programmer-VB                                             
                                                        
                                                                                
                                                        
                                                                                
                                                        



Mohon pencerahan rekan milis, lg puyeng nih,

Misal saya punya beberapa kelompok yg berisi puluhan objek seperti
label, textbox, dll. Indeks tiap objek ini disimpan dalam array. Jadi
label/text kelompok pertama namanya label(1), text(1) dst.

Terus saya mau mencoba memproses beberapa kelompok saja (nggak semua).
Kalo dalam kelompok ini cuman 9 atau 10 objek mungkin nggak masalah,
tp kalo udah nyampe 20 puluh atau 30 puluh objek kan nggak efisien
kalo mesti ditulis satu demi satu objek2 tersebut.

Algoritmanya kayak gini :

-------------------------------------------------------
For i = 1 to [jumlahkelompok]
    if i = [indeks_kelompok_yg_dipilih] then
        label1(i).visible = true
        text1(i).visible = true
               ....
        label20(i).visible = true
        text20(i).visible = true
    end if
next i
--------------------------------------------------------

Ada nggak rutin buat menyingkat objek2 diantara statement if dan endif
ini, supaya bisa dijalankan dalam satu perintah ?
Kalo dibahasakan ke bahasa manusia mah :
"Buat properti visible semua objek yg indeksnya dipilih menjadi true".

itu aja. dulu. Makasih buat bantuannya.


-Ardhi-
VB Beginner





Wahana Programmer Groups Links




Yahoo! Groups Links













Wahana Programmer Groups Links

<*> Untuk mengunjungi sponsor milis ini, klik link berikut:
    http://wahanaprogrammer.net

<*> Untuk menghubungi owner milis ini, kirim email ke:
    [EMAIL PROTECTED]

<*> Konsultasi pemrogramman bisa chat disini:
    Yahoo! Messenger: wahanaprogrammer
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/Programmer-VB/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Kirim email ke