Windows Develop Bookmark and Share   
 index > Windows Forms Designer > displaying pictures from textboxes
 

displaying pictures from textboxes

how would i display a picture that corisponeds to the textbox entry

ex. if you enter apple it would display a picture of an apple

edit:  in vb

tomjohnr  Monday, October 16, 2006 3:17 PM
On (for example) TextBox1 KeyPress event:

{
if (e.KeyChar == '\r')
{
// when you press enter key
LoadImagePicture(TextBox1.Text);
TextBox1.Text=string.Empty;
}
}

private void LoadImagePicture(string picture)
{
switch(picture)
{
case "apple":
pictureBox1.Load("C:\\Documents and Settings\\admin\\Escritorio\\Proyectos .NET\\C#\\Images\\est.gif");
break;
[... etc .. etc.. etc.. ]
}
}

Regards.
vtortola  Monday, October 16, 2006 3:35 PM
i need the coding for it in vb
tomjohnr  Wednesday, October 18, 2006 1:59 PM

You can use google to search for other answers

Custom Search

More Threads

• Tracking text entry position
• Having problems with IDesignerHost with Global selecting.
• Override DefaultPropertyAttribute
• Datagridview column header color
• designer not showing localized exceptionmessages
• Refresh problem when using MonthCalendar control in custom UITypeEditor
• Naming undo/redo action created by the well known GetPropertyByName
• Localizing DisplayMember
• Can't access IO namespace (C#)
• Tab and menustrip controls