dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: [2005] Inherit ToolTip for functionality and add RichTextBox and some DataGridViews

  1. #1
    Join Date
    Dec 2008
    Posts
    2

    [2005] Inherit ToolTip for functionality and add RichTextBox and some DataGridViews

    I have a form with a RichEditBox. With form.Show("some example text") the form gets opened and the size is exact as long as the text.
    Now I want a ToolTip that works exactly the same. So I want to inherit the ToolTip for its functionality. My problem is, that I don't know how to display an ToolTip with SetToolTip where I have a RichTextBox.
    On top of that I need a ToolTip-Version with DataGridViews.


    I inherit the ToolTip, but I don't know how to get the RichEditBox and a few DataGridViews into the tooltip. How do I code this? Links to help are also welcome (I couldn't found anything here or with google...)!

    Code:
    Public Class MyTooltip
    Inherits ToolTip
    Public Sub New()
    MyBase.New()
    End Sub
    
    Public Sub New(ByVal Cont As System.ComponentModel.IContainer)
    MyBase.New(Cont)
    End Sub
    
    Public Shadows Sub SetToolTip(ByVal control As Control, ByVal caption As String)
    Static myLastText As String
    
    MyBase.SetToolTip(control, caption)
    
    ' Add richtextbox here
    
    If caption <> myLastText Then
    myLastText = caption
    myrichtextbox.Text = myLastText
    formatRichTextBox(myrichtextbox) ' private function
    End If
    End Sub
    End Class

  2. #2
    Join Date
    Dec 2008
    Posts
    2

    Re: [2005] Inherit ToolTip for functionality and add RichTextBox and some DataGridVie

    I got a little further with my problem. I have a form now with a RichTextBox, but the problem ist to show the form in the right moment. And to place it right.


    I coudn't found a method / event which is called every time after the original .NET timer of the ToolTip runs out so that the ToolTip gets visible (the rectangle/baloon). I want to place in this event the code segment "Form.Show".
    On top of that I need the coordinates of the original .NET ToolTip (where the original ToolTip puts it's rectangle/baloon).
    Do you know the event / method, so that I can override or shadow it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)