Hover over column headers

Posted by: himaheshh on 8 September 2017, 1:56 pm EST

  • Posted 8 September 2017, 1:56 pm EST

    Hi,


    I am using the spread for windows. Is it possible to display a custom text when hover over the column header? The custom text should not be displayed when the mouse floats around the rows.


    If it is possible, please also advice any impact to the performance.


     Regards


    Mahesh

  • Replied 8 September 2017, 1:56 pm EST

    Hello,


    <FONT size=2>In order to display text while Hovering over the column header, set <FONT size=2>TextTipPolicy property as <FONT size=2>FarPoint.Win.Spread.TextTipPolicy.Floating and write the code to display text in T<FONT size=2>extTipFetch Event for Column Header postion.Below is the code that might help you to understand it better,</FONT></FONT></FONT></FONT>

    <FONT color=#0000ff size=2><FONT color=#0000ff size=2>

    Private</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub</FONT></FONT><FONT size=2> Form1_Load(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> sender </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> System.Object, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> e </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> System.EventArgs) </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Handles</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>MyBase</FONT></FONT><FONT size=2>.Load


    FpSpread1.TextTipPolicy = FarPoint.Win.Spread.TextTipPolicy.Floating


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Private</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub</FONT></FONT><FONT size=2> FpSpread1_TextTipFetch(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> sender </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Object</FONT></FONT><FONT size=2>, </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>ByVal</FONT></FONT><FONT size=2> e </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>As</FONT></FONT><FONT size=2> FarPoint.Win.Spread.TextTipFetchEventArgs) </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Handles</FONT></FONT><FONT size=2> FpSpread1.TextTipFetch


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>If</FONT></FONT><FONT size=2> e.ColumnHeader = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>True</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Then

    </FONT></FONT><FONT size=2>

    MsgBox(</FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"hello"</FONT></FONT><FONT size=2>)


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>If

    </FONT></FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>End</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>Sub

    </FONT></FONT>

     


    <FONT size=2><FONT size=2><FONT size=2><FONT size=2></FONT></FONT></FONT></FONT> 


    <FONT size=2><FONT size=2><FONT size=2><FONT size=2></FONT></FONT></FONT></FONT> 


    <FONT size=2><FONT size=2><FONT size=2><FONT size=2>Regards,

    </FONT></FONT></FONT></FONT>
  • Replied 8 September 2017, 1:56 pm EST

    Hi,


     Thank you.


    But the code below, doesnt show the text unless the column width is less than the length of the column header text.


    <FONT color=#0000ff size=2><FONT color=#0000ff size=2> 


    private</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>void</FONT></FONT><FONT size=2> fpSpread1_TextTipFetch(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>object</FONT></FONT><FONT size=2> sender, </FONT><FONT color=#008080 size=2><FONT color=#008080 size=2>TextTipFetchEventArgs</FONT></FONT><FONT size=2> e)


    {


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> (e.ColumnHeader)


    {


    e.TipText = </FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"It is a Measure"</FONT></FONT><FONT size=2>;


    }


    }


    Please correct me if I am doing something wrong.


    Thank you


     

    </FONT>
  • Replied 8 September 2017, 1:56 pm EST

    Hello Mahesh,


    In order to show Text Tip , you need to turn <FONT size=2>e.ShowTip = </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>True <FONT color=#000000>. So the code should look like this, </FONT></FONT></FONT>

    <FONT color=#0000ff size=2><FONT color=#0000ff size=2>

    private<FONT color=#000000 size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>void</FONT></FONT><FONT color=#000000 size=2> fpSpread1_TextTipFetch(</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>object</FONT></FONT><FONT color=#000000 size=2> sender, </FONT><FONT color=#008080 size=2><FONT color=#008080 size=2>TextTipFetchEventArgs</FONT></FONT><FONT size=2><FONT color=#000000> e)</FONT>


    <FONT color=#000000>{</FONT>


    </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> <FONT color=#000000>(e.ColumnHeader)</FONT>


    <FONT color=#000000>{</FONT>


    <FONT color=#000000>e.ShowTip = True</FONT> 


    <FONT color=#000000>e.</FONT><FONT color=#000000>TipText =</FONT> </FONT><FONT color=#800000 size=2><FONT color=#800000 size=2>"It is a Measure"</FONT></FONT><FONT size=2>;


    <FONT color=#000000>}</FONT>


    <FONT color=#000000>}</FONT>


    <FONT color=#000000>I hope it will help you.</FONT>


    <FONT color=#000000></FONT> 


    <FONT color=#000000>Regards,</FONT>


    <FONT color=#000000></FONT> 

    </FONT></FONT></FONT>
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels