locked
Message display when cursor is in the Text Box in FoxPro. RRS feed

  • Question

  • I want to open/display a message (what is the data should be entered in this field) when the cursor is in Text Box of Visual FoxPro Form.
    Tuesday, July 19, 2011 6:07 AM

Answers

  • i think what you are thinking of is a "ToolTip"

      private void Form1_Load(object sender, EventArgs e)
      {
       this.textBox1.MouseEnter += new EventHandler(textBox1_MouseEnter);
      }
    
      void textBox1_MouseEnter(object sender, EventArgs e)
      {
       this.toolTip1.Show("your text here", this.textBox1);
      }
    

    note that i broke common practice here, when you add the event handler, do it from the properties pane of the text box control NOT in the form load event.

    when your mouse enters the text box, the MouseEnter event is raised and displays the tooltip with your message.


    ZdPav
    • Proposed as answer by Zach Pavelka Thursday, July 28, 2011 4:38 AM
    • Marked as answer by Cookie Luo Wednesday, August 3, 2011 3:02 AM
    Thursday, July 28, 2011 4:25 AM

All replies

  • What do you mean "to open/display a message"??

    Can you describe a bit better?


    Mitja
    Tuesday, July 19, 2011 6:16 AM
  • i think what you are thinking of is a "ToolTip"

      private void Form1_Load(object sender, EventArgs e)
      {
       this.textBox1.MouseEnter += new EventHandler(textBox1_MouseEnter);
      }
    
      void textBox1_MouseEnter(object sender, EventArgs e)
      {
       this.toolTip1.Show("your text here", this.textBox1);
      }
    

    note that i broke common practice here, when you add the event handler, do it from the properties pane of the text box control NOT in the form load event.

    when your mouse enters the text box, the MouseEnter event is raised and displays the tooltip with your message.


    ZdPav
    • Proposed as answer by Zach Pavelka Thursday, July 28, 2011 4:38 AM
    • Marked as answer by Cookie Luo Wednesday, August 3, 2011 3:02 AM
    Thursday, July 28, 2011 4:25 AM
  • Just select the text box> select "ToolTipText" from properties and write the message, what you want to display/show.
    Tuesday, August 28, 2012 10:31 AM