Click here to Skip to main content
15,885,244 members
Home / Discussions / C#
   

C#

 
AnswerRe: Need Help With Syntax Pin
phil.o23-Nov-19 10:25
professionalphil.o23-Nov-19 10:25 
GeneralRe: Need Help With Syntax Pin
Kevin Marois23-Nov-19 10:40
professionalKevin Marois23-Nov-19 10:40 
GeneralRe: Need Help With Syntax Pin
Kevin Marois23-Nov-19 10:58
professionalKevin Marois23-Nov-19 10:58 
GeneralRe: Need Help With Syntax Pin
phil.o23-Nov-19 11:29
professionalphil.o23-Nov-19 11:29 
RantRe: Need Help With Syntax Pin
Kevin Marois23-Nov-19 12:26
professionalKevin Marois23-Nov-19 12:26 
GeneralRe: Need Help With Syntax Pin
phil.o23-Nov-19 12:45
professionalphil.o23-Nov-19 12: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 1:14
Member 443266022-Nov-19 1: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 1:31
mveOriginalGriff22-Nov-19 1: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:
C#
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 3:07
Member 443266023-Nov-19 3: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 4:00
mveOriginalGriff23-Nov-19 4: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 19:16
Member 443266023-Nov-19 19:16 
QuestionDifferences of 3 libraries in voice programming ? Pin
Member 245846721-Nov-19 15:55
Member 245846721-Nov-19 15:55 
AnswerRe: Differences of 3 libraries in voice programming ? Pin
Richard MacCutchan21-Nov-19 21:33
mveRichard MacCutchan21-Nov-19 21:33 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
OriginalGriff21-Nov-19 22:51
mveOriginalGriff21-Nov-19 22:51 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Richard MacCutchan21-Nov-19 23:05
mveRichard MacCutchan21-Nov-19 23:05 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
phil.o22-Nov-19 7:03
professionalphil.o22-Nov-19 7:03 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Member 245846724-Nov-19 14:25
Member 245846724-Nov-19 14:25 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Richard MacCutchan24-Nov-19 22:11
mveRichard MacCutchan24-Nov-19 22:11 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Super Lloyd24-Nov-19 18:21
Super Lloyd24-Nov-19 18:21 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Richard MacCutchan24-Nov-19 22:07
mveRichard MacCutchan24-Nov-19 22:07 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Super Lloyd25-Nov-19 11:52
Super Lloyd25-Nov-19 11:52 
GeneralRe: Differences of 3 libraries in voice programming ? Pin
Member 245846728-Nov-19 19:25
Member 245846728-Nov-19 19:25 
QuestionHow to delete a file during build/execute in C# Pin
Member 1466381121-Nov-19 5:24
Member 1466381121-Nov-19 5:24 
AnswerRe: How to delete a file during build/execute in C# Pin
OriginalGriff21-Nov-19 6:00
mveOriginalGriff21-Nov-19 6:00 
Question[Solved] Drag and Drop a folder to a textBox within a User Control Pin
W3453121-Nov-19 2:45
W3453121-Nov-19 2: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.