Click here to Skip to main content
13,899,972 members
Rate this:
Please Sign up or sign in to vote.
See more:

how can I do visible only range of textboxes.

For example:

In textbox100 will be value 10 and I would like to do visible only first 10 textboxes and next hide.

is it possible?

What I have tried:

I have not tried anything yet
Updated 6-Dec-18 5:58am
F-ES Sitecore 6-Dec-18 11:27am
Website? Windows Forms? WPF?
Fiínek Cahů 6-Dec-18 11:46am
windows forms

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Iterate through the Controls collection, and set Visible to false:

Dim count As Integer = 0

For Each c As Control In Controls
    Dim tb As TextBox = TryCast(c, TextBox)

    If tb IsNot Nothing Then
        count += 1
        tb.Visible = count <= 10
    End If
Fiínek Cahů 6-Dec-18 12:35pm
thank you
OriginalGriff 6-Dec-18 13:34pm
You're welcome!
Fiínek Cahů 6-Dec-18 12:58pm
And control if textbox contain some text? if contain then select next textbox?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web04 | 2.8.190306.1 | Last Updated 6 Dec 2018
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100