|
-
May 24th, 2007, 11:21 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Locating a control in a multipage
Suppose you have a multipage with n pages. In each page there are some textboxes.
Is it possible to get the page number where one specific textbox lies?
Last edited by Fonty; May 24th, 2007 at 11:35 AM.
-
May 24th, 2007, 01:43 PM
#2
Re: [RESOLVED] Locating a control in a multipage
If this is resolved, please post your resoultion as it may help someone else with the same or similiar problem.
-
May 24th, 2007, 01:50 PM
#3
Thread Starter
Addicted Member
Re: [RESOLVED] Locating a control in a multipage
I called the n pages of the multipage mpgMap as follows: pg1, pg2, pg3,..., pg8
The number of every page is the same as the mpgMap.Value, then in order to locate the controls I use the following code
vb Code:
Sub Check()
Dim c As Control
Dim origin as Integer
For Each c in mpgMapa.Controls
'Checks if the textboxes in the multipage contain only numbers
If Left(c.Name,6) = "txtBox" And IsNumeric(c) = False Then
'Pops up a warning message
msgbox "You must fill the case with numbers", "ERROR"
'Get the number of the page where the textbox lies
origin = Right(c.parent.Name,1)
'Activate the page
mpgMap.Value = origin
'Activate the textbox
c.SetFocus
Next
End Sub
Ps. I can't get this thing to format the code
Last edited by Hack; May 25th, 2007 at 07:04 AM.
Reason: Added VB Highlight Tags
-
May 25th, 2007, 07:07 AM
#4
Re: [RESOLVED] Locating a control in a multipage
 Originally Posted by Fonty
Ps. I can't get this thing to format the code
There are two ways to format your code (I edited you previous post and add highlight tags, which is one way.)
The two ways are using either [highlight=vb]your code goes in here[/highlight]
Or
[code]your code goes here[/code]
The code tags are more used as the code is more easily copied by other members than code surrounded by the highlight tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|