Showing posts with label C# Form. Show all posts
Showing posts with label C# Form. Show all posts

Sep 28, 2016

[Fixed Solution] Show A Message When Mouse Hovers Over A Button In Windows Forms Application

In a windows forms application, sometimes you may wanted to show a mouse hover text on it, just like in web application. The easy way to do it is using a tool tip. 

In this blog post I'm going to show you a easy way of doing it. With just two lines of C# codes.  Simply you can do this using a MouseHover event. To do that click your button in designer mode and go to events in properties window. Now find the MouseHover event and double click in that. You will get the mouse hover event code. Simply use the below codes to show the text.


1
2
3
4
5
public void btnTest_MouseHover(object sender, EventArgs e)
{
 System.Windows.Forms.ToolTip toolTip = new System.Windows.Forms.ToolTip();
 toolTip.SetToolTip(btnTest, "This is a test text");
}

Feb 4, 2014

Change Form Events From Another Form(Hide,Close,Show)

When Ever You Want To Do Any Events Like  Hide,Close,Show Of A Form From Another Form You Can Use Following Code.
When Ever Dispose a Object In A Form From Another Form Make Sure All The Child Class Objects Relevant To That Object Are Closed.


for (int index = Application.OpenForms.Count - 1; index >= 0; index--)
{
    if (Application.OpenForms[index].Name == "Your Form Name")
    {
        Application.OpenForms[index].Close();//To Close
    }
    else if (Application.OpenForms[index].Name == "Your Form Name")
    {
        Application.OpenForms[index].Hide();//To Hide
    }
    else if (Application.OpenForms[index].Name == "Your Form Name")
    {
        Application.OpenForms[index].Show();//To Show
    }
}


JWT Token Decode Using Jquery

When it come to authentication we use many mechanism. Ones the user authenticated we must keep these details somewhere safe. So we can share...