Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Clearing textboxes of displayed form

$
0
0
Hi, hope you all had good times with you families this holyday!

I'm looking for a better/cleaner way to clear all textboxes and radiobuttons on the currently visible form(that has control)

The way I know to do it is :

        ' Main form is called "Main" and other pages are called "Page1" trough "Page10"
    If ComboBox1.SelectedIndex = "1" Then
        Page1.textbox1.text = ""
        Page1.textbox2.text = ""
        '...
        Page1.textbox11.text = ""
        Page1.textbox12.text = ""
        Page1.radiobutton1.checked = False
        Page1.radiobutton2.checked = false
        '...
        End If
        If ComboBox1.SelectedIndex = "2" Then
        Page2.textbox1.text = ""
        Page2.textbox2.text = ""
        '... (you see the pathern :P/> )



I just can't find a way to do. I can't find a way to refer to textboxes in a specific form without directly naming it.

Any help, code, hint is much appreciated!
Thank you,

TheJoy

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>