Click here to Skip to main content
16,009,728 members
Home / Discussions / C#
   

C#

 
GeneralRe: Conditional Compilation Pin
BoneSoft19-Jul-07 7:59
BoneSoft19-Jul-07 7:59 
AnswerRe: Conditional Compilation Pin
Luc Pattyn19-Jul-07 5:41
sitebuilderLuc Pattyn19-Jul-07 5:41 
GeneralRe: Conditional Compilation Pin
BoneSoft19-Jul-07 8:01
BoneSoft19-Jul-07 8:01 
QuestionAccess variable from Global asax to a asmx page Pin
ramdil19-Jul-07 4:54
ramdil19-Jul-07 4:54 
AnswerRe: Access variable from Global asax to a asmx page Pin
kubben19-Jul-07 7:15
kubben19-Jul-07 7:15 
GeneralRe: Access variable from Global asax to a asmx page Pin
ramdil19-Jul-07 23:40
ramdil19-Jul-07 23:40 
GeneralRe: Access variable from Global asax to a asmx page Pin
kubben20-Jul-07 1:21
kubben20-Jul-07 1:21 
GeneralRe: Access variable from Global asax to a asmx page Pin
ramdil20-Jul-07 2:43
ramdil20-Jul-07 2:43 
GeneralRe: Access variable from Global asax to a asmx page Pin
kubben20-Jul-07 2:48
kubben20-Jul-07 2:48 
GeneralRe: Access variable from Global asax to a asmx page Pin
ramdil20-Jul-07 4:58
ramdil20-Jul-07 4:58 
QuestionAccessing Control on my webpage Pin
imnotso#19-Jul-07 4:06
imnotso#19-Jul-07 4:06 
AnswerRe: Accessing Control on my webpage Pin
kubben19-Jul-07 4:20
kubben19-Jul-07 4:20 
GeneralRe: Accessing Control on my webpage Pin
Manas Bhardwaj19-Jul-07 4:41
professionalManas Bhardwaj19-Jul-07 4:41 
GeneralRe: Accessing Control on my webpage Pin
imnotso#19-Jul-07 4:54
imnotso#19-Jul-07 4:54 
GeneralRe: Accessing Control on my webpage Pin
kubben19-Jul-07 7:06
kubben19-Jul-07 7:06 
QuestionKeywords in c# Pin
.NET- India 19-Jul-07 3:33
.NET- India 19-Jul-07 3:33 
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 

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.