Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 25th, 2009, 04:51 AM
Authorized User
Join Date: Feb 2009
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default Dynamic Add User Control Object To The Tab Control

Anyone can suggest what's wrong to the code below as the User Control objects ONLY appear in the first tab and NOT in the balance tabs ?

1) User Control name - usRFQDetail
2) Tab Control name - tcRFQDetail

Dim tcPage As New TabPage
Dim ucRFQDetailInstance As usRFQDetail() = New usRFQDetail(100) {}

Dim sdrReader As SqlDataReader = cmdReader.ExecuteReader(CommandBehavior.CloseConne ction)

With sdrReader
If .HasRows Then
ucRFQDetailInstance(intTotalTab) = New usRFQDetail
tcRFQDetail.TabPages(intCurrentTab).Text = .GetString(.GetOrdinal("DrawingNo"))
While .Read
intCurrentTab += 1
tcPage.Text = .GetString(.GetOrdinal("DrawingNo"))
tcRFQDetail.TabPages.Add(tcPage) tcRFQDetail.TabPages(intCurrentTab).Controls.Add(u cRFQDetailInstance(intCurrentTab))
End While

Last edited by cheer; February 25th, 2009 at 04:53 AM..
  #2 (permalink)  
Old February 25th, 2009, 10:48 PM
Authorized User
Join Date: Feb 2009
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts

I have found the answer at the end. Below are the codes. Share with you all

While .Read
Dim tcPage As New TabPage()
Dim ucRFQDetailInstance As New usRFQDetail()
tcPage.Text = .GetString(.GetOrdinal("DrawingNo"))
With ucRFQDetailInstance
.Dock = DockStyle.Fill
End With
intCurrentTab += 1
End While

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Dynamic User Control Prabhakar_dt ASP.NET 2.0 Professional 1 June 6th, 2007 07:30 AM
Add Windows User control in Web User Control agarwalvidhu C# 0 March 30th, 2006 01:17 AM
User Control: Tab key does not work alhad VB.NET 2002/2003 Basics 0 November 3rd, 2005 03:20 AM
Dynamic user control problem sandeep General .NET 0 September 26th, 2005 09:42 AM
Add Dynamic Control HELP HELP jimmyfrank Access VBA 1 January 26th, 2005 06:05 PM

All times are GMT -4. The time now is 06:08 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.