Click here to Skip to main content
15,905,563 members
Home / Discussions / C#
   

C#

 
GeneralRe: 3tier - dataflow Pin
Thomas Weller28-Nov-08 18:32
Thomas Weller28-Nov-08 18:32 
QuestionHow to log msg in Remote machine event log... Pin
Chintan.Desai27-Nov-08 20:11
Chintan.Desai27-Nov-08 20:11 
AnswerRe: How to log msg in Remote machine event log... Pin
Abhijit Jana27-Nov-08 20:38
professionalAbhijit Jana27-Nov-08 20:38 
Questionhow to cast combobox Pin
sadara27-Nov-08 20:01
sadara27-Nov-08 20:01 
QuestionRemoting Unit Testing suggestions. Pin
Member 232448327-Nov-08 19:48
Member 232448327-Nov-08 19:48 
QuestionInternal buffer(I/O) size of serialport Pin
Shivarudrayya H27-Nov-08 18:00
Shivarudrayya H27-Nov-08 18:00 
AnswerRe: Internal buffer(I/O) size of serialport Pin
Mbah Dhaim27-Nov-08 19:43
Mbah Dhaim27-Nov-08 19:43 
Questioncreating ssis package on the fly using C# Pin
l.laxmikant27-Nov-08 17:43
l.laxmikant27-Nov-08 17:43 
Question[HELP] Attempted to access an element as a type incompatible with the array Pin
dnlmarshall27-Nov-08 15:38
dnlmarshall27-Nov-08 15:38 
AnswerRe: [HELP] Attempted to access an element as a type incompatible with the array Pin
Christian Graus27-Nov-08 15:40
protectorChristian Graus27-Nov-08 15:40 
GeneralRe: [HELP] Attempted to access an element as a type incompatible with the array Pin
dnlmarshall27-Nov-08 15:46
dnlmarshall27-Nov-08 15:46 
GeneralRe: [HELP] Attempted to access an element as a type incompatible with the array Pin
Christian Graus27-Nov-08 15:55
protectorChristian Graus27-Nov-08 15:55 
GeneralRe: [HELP] Attempted to access an element as a type incompatible with the array Pin
dnlmarshall27-Nov-08 16:04
dnlmarshall27-Nov-08 16:04 
QuestionCAS problem Pin
_anil_27-Nov-08 14:18
_anil_27-Nov-08 14:18 
AnswerRe: CAS problem Pin
V.27-Nov-08 20:25
professionalV.27-Nov-08 20:25 
Questionhow to record sound from a mic Pin
BahaaHany27-Nov-08 11:39
BahaaHany27-Nov-08 11:39 
AnswerRe: how to record sound from a mic Pin
Shyam Bharath27-Nov-08 18:34
Shyam Bharath27-Nov-08 18:34 
GeneralRe: how to record sound from a mic Pin
BahaaHany27-Nov-08 20:57
BahaaHany27-Nov-08 20:57 
GeneralRe: how to record sound from a mic Pin
Shyam Bharath27-Nov-08 22:56
Shyam Bharath27-Nov-08 22:56 
AnswerRe: how to record sound from a mic Pin
Pedram Behroozi27-Nov-08 21:09
Pedram Behroozi27-Nov-08 21:09 
QuestionGeneral programming ideea, just so I go the right way Pin
sodevrom27-Nov-08 11:15
sodevrom27-Nov-08 11:15 
AnswerRe: General programming ideea, just so I go the right way Pin
User 665827-Nov-08 11:39
User 665827-Nov-08 11:39 
I'm not sure I understand the problem correctly, but you can always add an arbitrary number of controls to a Control via its Controls collection. In your case it would look like this:

private void button_Click(object sender, EventArgs e)
{
    TabPage tabPage = new TabPage(((Button)sender).Text);

    Label label = new Label();
    label.Text = "Label";
    label.Location = new Point(10, 10);
    label.Size = new Size(100, 36);

    Button button = new Button();
    button.Text = "Button";
    button.Location = new Point(10, 50);
    button.Size = new Size(100, 36);

    tabPage.Controls.Add(label);
    tabPage.Controls.Add(button);

    tabControl1.TabPages.Add(tabPage);
}


There's no need to manually destroy the controls unless they need to be disposed.

regards

modified 12-Sep-18 21:01pm.

GeneralRe: General programming ideea, just so I go the right way Pin
sodevrom27-Nov-08 11:45
sodevrom27-Nov-08 11:45 
GeneralRe: General programming ideea, just so I go the right way Pin
User 665827-Nov-08 14:01
User 665827-Nov-08 14:01 
QuestionC# WinForms DataBinding? Pin
wbjohnson27-Nov-08 10:25
wbjohnson27-Nov-08 10:25 

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

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