PC Review


Reply
Thread Tools Rate Thread

creating runtime tabpages with runtime controls C#

 
 
Elp
Guest
Posts: n/a
 
      16th Jul 2004

"rp" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> How would I create runtime tabpages with runtime
> controls(textBoxes,comboBox, checkedListBox), inserting,deleting, and
> modifing the tabpages whenever I want to in C#? Thanks in advance.


You do all that in the designer and then have a look at the generated code
to understand how to do it programmatically.

For example, to create a tab page and add it to your tab control tabControl:
TabPage page = new TabPage("My new tab");
tabControl.Controls.Add(page);

To create a button and dock it on the bottom of your tab page:
Button button = new Button();
button.Text = "Test Button";
button.Dock = DockStyle.Bottom;
page.Controls.Add(button);

To remove this button from your tab page:
page.Controls.Remove(button);

Note that to be able to modify your controls anytime during runtime, you
need to keep a reference to them somewhere. You could for example make them
member variables of your class. There are of course also plenty of other
solutions to add, remove, modify and get references to your controls at
runtime. Have a look at the doc of all the controls you need.


 
Reply With Quote
 
 
 
 
rp
Guest
Posts: n/a
 
      16th Jul 2004
Hi,

How would I create runtime tabpages with runtime
controls(textBoxes,comboBox, checkedListBox), inserting,deleting, and
modifing the tabpages whenever I want to in C#? Thanks in advance.

rp
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Creating Controls at RunTime Daniel Moth Microsoft Dot NET Compact Framework 0 9th Sep 2005 09:16 PM
creating controls at runtime =?Utf-8?B?amNyb3VzZQ==?= Microsoft VB .NET 3 8th Jun 2004 10:27 PM
Create TabPages at runtime (with controls) Luc Microsoft VB .NET 1 20th May 2004 06:17 PM
creating controls at runtime defj Microsoft Excel Programming 2 2nd Dec 2003 07:14 AM
creating controls at runtime Dan Microsoft Access Form Coding 0 26th Nov 2003 10:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:34 AM.