Click here to Skip to main content
       

.NET Framework

 
GeneralRe: [VB.NET 2008] How to detect if a page of a TabControl is selected (Windows CE) Pinmembersteve_949661311-Dec-12 21:20 
GeneralRe: [VB.NET 2008] How to detect if a page of a TabControl is selected (Windows CE) PinmemberZaf Khan12-Dec-12 2:13 
Question[VB.NET 2008] How to get control on objects created at runtime Pinmembersteve_94966135-Dec-12 4:54 
AnswerRe: [VB.NET 2008] How to get control on objects created at runtime PinmemberEddy Vluggen5-Dec-12 5:40 
GeneralRe: [VB.NET 2008] How to get control on objects created at runtime Pinmembersteve_94966135-Dec-12 20:59 
GeneralRe: [VB.NET 2008] How to get control on objects created at runtime PinmemberEddy Vluggen6-Dec-12 2:27 
GeneralRe: [VB.NET 2008] How to get control on objects created at runtime Pinmembersteve_94966136-Dec-12 3:26 
GeneralRe: [VB.NET 2008] How to get control on objects created at runtime PinmemberEddy Vluggen6-Dec-12 5:02 
steve_9496613 wrote:
In the designer I create:
1 Form with 1 TabControl with 1 page
1 UserControl with 1 Button and 2 NumericUpDown
(in my first post there is the code of the Form and the code of the UserControl)

At runtime I add 10 pages to the TabControl with a copy of the UserControl in each page.

My problem is in these 10 pages, for this reason I wrote "at runtime" in the topic title.

Good explanation Thumbs Up | :thumbsup:
 
"NUD1", the name-property of the UpDown control, must be unique within the form. It'll generate a variable with that name, and that's what "NUD1" points to; it's not a property of the tabpage, it's the name of a single control.
 
Ideally, you'd have your own type of tabpage, but I don't know whether the designer would accept that. Might make it impossible to show the page at all in the designer.
 
The "easy" way is to loop trough all the controls on the current tabpage. There's a Controls-collection that you'd have to loop through, and check whether that's the control (of type numericupdown) that you're looking for.
 
Not very elegant at all, is it?
 
So, I'd suggest putting everything you want on that page in a single UserControl, and make it's values available over properties. That way you can instantiate the same control ten times, and still have all the logic and layout in a single place.
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]
They hate us for our freedom![^]

GeneralRe: [VB.NET 2008] How to get control on objects created at runtime Pinmembersteve_94966136-Dec-12 21:25 
GeneralRe: [VB.NET 2008] How to get control on objects created at runtime PinmemberEddy Vluggen7-Dec-12 1:16 
QuestionTesting Practices PinmemberAndrew Stoute5-Dec-12 4:44 
AnswerRe: Testing Practices PinmemberEddy Vluggen5-Dec-12 5:36 
GeneralRe: Testing Practices PinmemberAndrew Stoute5-Dec-12 5:45 
GeneralRe: Testing Practices PinmemberEddy Vluggen5-Dec-12 5:53 
GeneralRe: Testing Practices PinmvpDave Kreskowiak5-Dec-12 6:29 
GeneralRe: Testing Practices PinmvpDave Kreskowiak5-Dec-12 6:26 
GeneralRe: Testing Practices PinmemberEddy Vluggen5-Dec-12 6:34 
GeneralRe: Testing Practices PinmvpDave Kreskowiak5-Dec-12 9:55 
GeneralRe: Testing Practices PinmemberEddy Vluggen6-Dec-12 0:08 
QuestionHow to make a list view and gallerie view on a product page list on some e-commerce PinmemberEl daniel4-Dec-12 0:19 
AnswerRe: How to make a list view and gallerie view on a product page list on some e-commerce PinmemberEddy Vluggen4-Dec-12 0:37 
Questionframework 2.0 and win98 Pinmembercaradri3-Dec-12 22:37 
AnswerRe: framework 2.0 and win98 PinmvpRichard MacCutchan3-Dec-12 23:01 
AnswerRe: framework 2.0 and win98 PinmemberEddy Vluggen3-Dec-12 23:04 
AnswerRe: framework 2.0 and win98 PinprotectorPete O'Hanlon3-Dec-12 23:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.141015.1 | Last Updated 19 Oct 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid