Click here to Skip to main content
15,896,348 members
Home / Discussions / C#
   

C#

 
AnswerRe: Keywords in c# Pin
Colin Angus Mackay19-Jul-07 3:35
Colin Angus Mackay19-Jul-07 3:35 
AnswerRe: Keywords in c# Pin
Luc Pattyn19-Jul-07 4:11
sitebuilderLuc Pattyn19-Jul-07 4:11 
GeneralRe: Keywords in c# Pin
Colin Angus Mackay19-Jul-07 4:14
Colin Angus Mackay19-Jul-07 4:14 
GeneralRe: Keywords in c# Pin
Luc Pattyn19-Jul-07 5:43
sitebuilderLuc Pattyn19-Jul-07 5:43 
Questionchanging system colors Pin
Bekjong19-Jul-07 3:16
Bekjong19-Jul-07 3:16 
AnswerRe: changing system colors Pin
mark_w_19-Jul-07 5:24
mark_w_19-Jul-07 5:24 
GeneralRe: changing system colors Pin
Bekjong19-Jul-07 5:36
Bekjong19-Jul-07 5:36 
QuestionHow to remove the control? Pin
Dotnetkanna19-Jul-07 3:11
Dotnetkanna19-Jul-07 3:11 
Hi everybody,

I Had used the below code to adding the textbox contorl dynamically and nodes in the treeview but i have no idea to how to remove the created control by using the control name onbutton click and also i have to remove the corresponding nodes in the treeview.any suggestion?



int n = 25;
int m = 1;

private void BtnAddControl_Click(object sender, EventArgs e)
{
TextBox txtBox = new TextBox();
txtBox.Text = "TextBox" + m;
txtBox.TabIndex=m;
txtBox.Tag=m;
txtBox.Location = new System.Drawing.Point(10, n);
txtBox.Size = new System.Drawing.Size(70, 20);
txtBox.Name = "TextBox" + m;


txtBox.Click +=new EventHandler(txtBox_Click);
this.Controls.Add(txtBox);

TreeNode root = null;
if (TV.Nodes.Count == 0)
{
root = new TreeNode("TextBox");
root.Nodes.Add(txtBox.Name);
TV.Nodes.Add(root);
}
else
{
TV.Nodes[0].Nodes.Add(txtBox.Name);
}

TV.ExpandAll();
n = n + 20;
m++;
}








Regards

Kanna

AnswerRe: How to remove the control? Pin
Martin#19-Jul-07 3:19
Martin#19-Jul-07 3:19 
GeneralRe: How to remove the control? Pin
Luc Pattyn19-Jul-07 4:15
sitebuilderLuc Pattyn19-Jul-07 4:15 
GeneralRe: How to remove the control? Pin
Martin#19-Jul-07 4:17
Martin#19-Jul-07 4:17 
GeneralRe: How to remove the control? Pin
Luc Pattyn19-Jul-07 4:22
sitebuilderLuc Pattyn19-Jul-07 4:22 
GeneralRe: How to remove the control? Pin
Larantz19-Jul-07 11:55
Larantz19-Jul-07 11:55 
GeneralRe: How to remove the control? Pin
Martin#19-Jul-07 19:07
Martin#19-Jul-07 19:07 
GeneralRe: How to remove the control? Pin
Dotnetkanna19-Jul-07 19:47
Dotnetkanna19-Jul-07 19:47 
GeneralRe: How to remove the control? Pin
Martin#19-Jul-07 19:48
Martin#19-Jul-07 19:48 
Questionrating of images Pin
APHerman19-Jul-07 3:03
APHerman19-Jul-07 3:03 
QuestionRe: rating of images Pin
Eduard Keilholz19-Jul-07 3:16
Eduard Keilholz19-Jul-07 3:16 
AnswerRe: rating of images Pin
APHerman19-Jul-07 3:22
APHerman19-Jul-07 3:22 
GeneralRe: rating of images Pin
Larantz19-Jul-07 11:58
Larantz19-Jul-07 11:58 
GeneralRe: rating of images Pin
APHerman19-Jul-07 20:52
APHerman19-Jul-07 20:52 
QuestionData Table Pin
Blubbo19-Jul-07 2:56
Blubbo19-Jul-07 2:56 
AnswerRe: Data Table Pin
mrwisdom17-Dec-08 20:48
mrwisdom17-Dec-08 20:48 
Questiongridview with combo Pin
manoj_ce19-Jul-07 2:51
manoj_ce19-Jul-07 2:51 
AnswerRe: gridview with combo Pin
kubben19-Jul-07 4:22
kubben19-Jul-07 4:22 

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.