Click here to Skip to main content
14,386,540 members
   

C#

 
AnswerRe: Need Help With Syntax Pin
phil.o23-Nov-19 11:25
mvephil.o23-Nov-19 11:25 
GeneralRe: Need Help With Syntax Pin
Kevin Marois23-Nov-19 11:40
professionalKevin Marois23-Nov-19 11:40 
GeneralRe: Need Help With Syntax Pin
Kevin Marois23-Nov-19 11:58
professionalKevin Marois23-Nov-19 11:58 
GeneralRe: Need Help With Syntax Pin
phil.o23-Nov-19 12:29
mvephil.o23-Nov-19 12:29 
RantRe: Need Help With Syntax Pin
Kevin Marois23-Nov-19 13:26
professionalKevin Marois23-Nov-19 13:26 
GeneralRe: Need Help With Syntax Pin
phil.o23-Nov-19 13:45
mvephil.o23-Nov-19 13:45 
QuestionDeleting textbox created dynamically, using delete key, while there are more than 1 textbox that have been dragged and dropped on a picture box. Pin
Member 443266022-Nov-19 2:14
MemberMember 443266022-Nov-19 2:14 
AnswerRe: Deleting textbox created dynamically, using delete key, while there are more than 1 textbox that have been dragged and dropped on a picture box. Pin
OriginalGriff22-Nov-19 2:31
mveOriginalGriff22-Nov-19 2:31 
If it's dynamically created, you can enable, disable, or remove it very simply - provided you have the right instance.

And that means "finding" the exact TextBox that you issued a new statement on, and added to the PictureBox.Controls collection:
private void FrmMain_Shown(object sender, EventArgs e)
    {
    TextBox tb = new TextBox();
    ...
    myPictureBox.Controls.Add(tb);
    }

Unless you saved it in a class level variable, the simplest way to do that is probably to look in myPictureBox.Controls:
if (myPictureBox.Controls.Count > 0)
    {
    if (myPictureBox.Controls[0] is TextBox tb)
        {
        tb.Enabled = true;
        tb.Enabled = false;
        myPictureBox.Controls.Remove(tb);
        }
    }

"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Deleting textbox created dynamically, using delete key, while there are more than 1 textbox that have been dragged and dropped on a picture box. Pin
Member 443266023-Nov-19 4:07
MemberMember 443266023-Nov-19 4:07 
GeneralRe: Deleting textbox created dynamically, using delete key, while there are more than 1 textbox that have been dragged and dropped on a picture box. Pin
OriginalGriff23-Nov-19 5:00
mveOriginalGriff23-Nov-19 5:00 
GeneralRe: Deleting textbox created dynamically, using delete key, while there are more than 1 textbox that have been dragged and dropped on a picture box. Pin
Member 443266023-Nov-19 20:16
MemberMember 443266023-Nov-19 20:16 
QuestionDifferences of 3 libraries in voice programming ? Pin
Member 245846721-Nov-19 16:55
MemberMember 245846721-Nov-19 16:55 
AnswerRe: Differences of 3 libraries in voice programming ? Pin
Richard MacCutchan21-Nov-19 22:33
mveRichard MacCutchan21-Nov-19 22:33 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
OriginalGriff21-Nov-19 23:51
mveOriginalGriff21-Nov-19 23:51 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Richard MacCutchan22-Nov-19 0:05
mveRichard MacCutchan22-Nov-19 0:05 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
phil.o22-Nov-19 8:03
mvephil.o22-Nov-19 8:03 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Member 245846724-Nov-19 15:25
MemberMember 245846724-Nov-19 15:25 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Richard MacCutchan24-Nov-19 23:11
mveRichard MacCutchan24-Nov-19 23:11 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Super Lloyd24-Nov-19 19:21
MemberSuper Lloyd24-Nov-19 19:21 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Richard MacCutchan24-Nov-19 23:07
mveRichard MacCutchan24-Nov-19 23:07 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Super Lloyd25-Nov-19 12:52
MemberSuper Lloyd25-Nov-19 12:52 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Member 245846728-Nov-19 20:25
MemberMember 245846728-Nov-19 20:25 
QuestionHow to delete a file during build/execute in C# Pin
Member 1466381121-Nov-19 6:24
MemberMember 1466381121-Nov-19 6:24 
AnswerRe: How to delete a file during build/execute in C# Pin
OriginalGriff21-Nov-19 7:00
mveOriginalGriff21-Nov-19 7:00 
Question[Solved] Drag and Drop a folder to a textBox within a User Control Pin
W3453121-Nov-19 3:45
MemberW3453121-Nov-19 3:45 

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.