tooltip on listbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amitjaura
    New Member
    • Aug 2008
    • 14

    tooltip on listbox

    Can anybody guide me how to use tooltip on listbox
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Did you add a tooltip object to your form?

    Comment

    • amitjaura
      New Member
      • Aug 2008
      • 14

      #3
      Originally posted by Plater
      Did you add a tooltip object to your form?


      I dont know any thing abt it....It wud b nice if u will tell me

      Comment

      • amitjaura
        New Member
        • Aug 2008
        • 14

        #4
        Originally posted by Plater
        Did you add a tooltip object to your form?


        I hav used this code


        private void lstRecommendedT est_MouseHover( object sender, EventArgs e)
        {

        ToolTip tp = new ToolTip();
        tp.Show("hi", lstRecommendati ons, x, y, 1130);
        }



        private void lstRecommendedT est_MouseMove(o bject sender, MouseEventArgs e)
        {
        x = e.X;
        y = e.Y;
        }

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          It would be nice if you did any work for yourself.
          On your toolbar in designer mode you should be able to drag and drop a tooltip object onto your form.
          you can then add tooltip text to any of the controls on your form.
          MSDN ToolTip if need be.

          Comment

          • KodeKrazy
            New Member
            • Mar 2008
            • 32

            #6
            Drop a "ToolTip" component on to your form, view the properties of your ListBox control, and all of the Tool Tip properties are accessible. To set the message at RunTime: Me.ListBox1.Too lTip1.Text = (Whatever you want your Tool Tip to display when the user mouses over the control)

            KK

            Comment

            • amitjaura
              New Member
              • Aug 2008
              • 14

              #7
              private void lstRecommendedT est_MouseHover( object sender, EventArgs e)
              {

              tp.Show(lstReco mmendedTest.Sel ectedItem.ToStr ing(), lstRecommendedT est, x, y, 1300);
              this.toolTip1.S how(@@@@@Here I want to show the listbox item on which the mouse is hovered@@@@@, x, y, 1300);)
              }



              private void lstRecommendedT est_MouseMove(o bject sender, MouseEventArgs e)
              {
              x = e.X;
              y = e.Y;
              }


              The problem is dat I dont know hw to show the listbox item which is hovered in the tool tip

              Comment

              • joedeene
                Contributor
                • Jul 2008
                • 579

                #8
                Originally posted by amitjaura
                private void lstRecommendedT est_MouseHover( object sender, EventArgs e)
                {

                tp.Show(lstReco mmendedTest.Sel ectedItem.ToStr ing(), lstRecommendedT est, x, y, 1300);
                this.toolTip1.S how(@@@@@Here I want to show the listbox item on which the mouse is hovered@@@@@, x, y, 1300);)
                }



                private void lstRecommendedT est_MouseMove(o bject sender, MouseEventArgs e)
                {
                x = e.X;
                y = e.Y;
                }


                The problem is dat I dont know hw to show the listbox item which is hovered in the tool tip

                i dont think that you can do that, by just hover, when the user clicks on an item you can code it to show in the tooltip?

                Comment

                • Plater
                  Recognized Expert Expert
                  • Apr 2007
                  • 7872

                  #9
                  If you want a message to change on hover, I recomend just changing some label text near your listbox control. That way it can be changed imediately on mouse over, instead of trying to figure out the pause/wait time to show a popup tooltip and then closing it again.

                  Comment

                  Working...