Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PictureBox Tooltip changing C#

Ok so I am a complete beginner and have managed to put together a small app in C# where I enter a username in a textbox and the application gets the avatar of that username and displays it in a picturebox.

What i want to do is have a tooltip show the username that was typed in the textbox when mouse hovers over the loaded avatar. it should change each time a new avatar is loaded. I know how to use tooltips the normal way but this is a bit complex for me. Any help will be appreciated.

Thanks.

like image 993
BrandNewDev Avatar asked Sep 05 '25 12:09

BrandNewDev


1 Answers

Add a hover event to your picturebox with the following code.

private void pictureBox1_MouseHover(object sender, EventArgs e)
{
    ToolTip tt = new ToolTip();
    tt.SetToolTip(this.pictureBox1, "Your username");
}
like image 113
Joe Avatar answered Sep 09 '25 10:09

Joe