add text to background

Posted by: parez81-fp on 8 September 2017, 1:15 pm EST

  • Posted 8 September 2017, 1:15 pm EST

    Hi


    how do i add text to the background of the grid. I am pretty sure background is not the right word.
    Its the area that you seen when there are no rows in the grid.
    I want to display message like "No rows found";
  • Replied 8 September 2017, 1:15 pm EST

    Hello,


    You can implement your own IInterfaceRenderer and in the PaintGrayArea method draw whatever you want.

     
      <SPAN class=kwd>Private Sub</SPAN> Form1_Load(<SPAN class=kwd>ByVal</SPAN> sender <SPAN class=kwd>As</SPAN> System.<SPAN class=kwd>Object</SPAN>, <SPAN class=kwd>ByVal</SPAN> e <SPAN class=kwd>As</SPAN> System.EventArgs) <SPAN class=kwd>Handles MyBase</SPAN>.Load
    FpSpread1.InterfaceRenderer = <SPAN class=kwd>New</SPAN> myIFR
    <SPAN class=kwd>End Sub

    Private Sub</SPAN> Button1_Click(<SPAN class=kwd>ByVal</SPAN> sender <SPAN class=kwd>As Object</SPAN>, <SPAN class=kwd>ByVal</SPAN> e <SPAN class=kwd>As</SPAN> System.EventArgs) <SPAN class=kwd>Handles</SPAN> Button1.Click
    FpSpread1.Sheets(0).RowCount = 0
    <SPAN class=kwd>End Sub

    Public Class</SPAN> myIFR
    <SPAN class=kwd>Implements</SPAN> FarPoint.Win.Spread.IInterfaceRenderer

    <SPAN class=kwd>Dim</SPAN> enhR <SPAN class=kwd>As New</SPAN> FarPoint.Win.Spread.EnhancedInterfaceRenderer

    <SPAN class=kwd>Public Sub</SPAN> PaintButton(<SPAN class=kwd>ByVal</SPAN> g <SPAN class=kwd>As</SPAN> System.Drawing.Graphics, <SPAN class=kwd>ByVal</SPAN> x <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> y <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> width <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> height <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> button <SPAN class=kwd>As</SPAN> FarPoint.Win.Spread.TabStripButton, <SPAN class=kwd>ByVal</SPAN> mouseOver <SPAN class=kwd>As Boolean</SPAN>, <SPAN class=kwd>ByVal</SPAN> pressed <SPAN class=kwd>As Boolean</SPAN>, <SPAN class=kwd>ByVal</SPAN> isLeftToRight <SPAN class=kwd>As Boolean</SPAN>, <SPAN class=kwd>ByVal</SPAN> enabled <SPAN class=kwd>As Boolean</SPAN>) <SPAN class=kwd>Implements</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintButton
    enhR.PaintButton(g, x, y, width, height, button, mouseOver, pressed, isLeftToRight, enabled)
    <SPAN class=kwd>End Sub

    Public Sub</SPAN> PaintGrayArea(<SPAN class=kwd>ByVal</SPAN> g <SPAN class=kwd>As</SPAN> System.Drawing.Graphics, <SPAN class=kwd>ByVal</SPAN> x <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> y <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> width <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> height <SPAN class=kwd>As Integer</SPAN>) <SPAN class=kwd>Implements</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintGrayArea
    g.DrawString(<SPAN class=st>"No Rows To Display"</SPAN>, <SPAN class=kwd>New</SPAN> Font(<SPAN class=st>"Arial"</SPAN>, 14, FontStyle.Bold), Brushes.Red, 300, 50)
    <SPAN class=kwd>End Sub

    Public Sub</SPAN> PaintRangeGroupArea(<SPAN class=kwd>ByVal</SPAN> g <SPAN class=kwd>As</SPAN> System.Drawing.Graphics, <SPAN class=kwd>ByVal</SPAN> x <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> y <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> width <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> height <SPAN class=kwd>As Integer</SPAN>) <SPAN class=kwd>Implements</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintRangeGroupArea
    enhR.PaintRangeGroupArea(g, x, y, width, height)
    <SPAN class=kwd>End Sub

    Public Sub</SPAN> PaintRangeGroupButton(<SPAN class=kwd>ByVal</SPAN> g <SPAN class=kwd>As</SPAN> System.Drawing.Graphics, <SPAN class=kwd>ByVal</SPAN> x <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> y <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> width <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> height <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> groupState <SPAN class=kwd>As</SPAN> FarPoint.Win.Spread.GroupState, <SPAN class=kwd>ByVal</SPAN> rowGroup <SPAN class=kwd>As Boolean</SPAN>, <SPAN class=kwd>ByVal</SPAN> isLeftToRight <SPAN class=kwd>As Boolean</SPAN>) <SPAN class=kwd>Implements</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintRangeGroupButton
    enhR.PaintRangeGroupButton(g, x, y, width, height, groupState, rowGroup, isLeftToRight)
    <SPAN class=kwd>End Sub

    Public Sub</SPAN> PaintRangeGroupLevelBox(<SPAN class=kwd>ByVal</SPAN> g <SPAN class=kwd>As</SPAN> System.Drawing.Graphics, <SPAN class=kwd>ByVal</SPAN> x <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> y <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> width <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> height <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> groupLevel <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> rowGroup <SPAN class=kwd>As Boolean</SPAN>, <SPAN class=kwd>ByVal</SPAN> isLeftToRight <SPAN class=kwd>As Boolean</SPAN>) <SPAN class=kwd>Implements</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintRangeGroupLevelBox
    enhR.PaintRangeGroupLevelBox(g, x, y, width, height, groupLevel, rowGroup, isLeftToRight)
    <SPAN class=kwd>End Sub

    Public Sub</SPAN> PaintRangeGroupLine(<SPAN class=kwd>ByVal</SPAN> g <SPAN class=kwd>As</SPAN> System.Drawing.Graphics, <SPAN class=kwd>ByVal</SPAN> startPoint <SPAN class=kwd>As</SPAN> System.Drawing.Point, <SPAN class=kwd>ByVal</SPAN> endPoint <SPAN class=kwd>As</SPAN> System.Drawing.Point) <SPAN class=kwd>Implements</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintRangeGroupLine
    enhR.PaintRangeGroupLine(g, startPoint, endPoint)
    <SPAN class=kwd>End Sub

    Public Sub</SPAN> PaintRangeGroupPoint(<SPAN class=kwd>ByVal</SPAN> g <SPAN class=kwd>As</SPAN> System.Drawing.Graphics, <SPAN class=kwd>ByVal</SPAN> point <SPAN class=kwd>As</SPAN> System.Drawing.Point) <SPAN class=kwd>Implements</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintRangeGroupPoint
    enhR.PaintRangeGroupPoint(g, point)
    <SPAN class=kwd>End Sub

    Public Sub</SPAN> PaintScrollBox(<SPAN class=kwd>ByVal</SPAN> g <SPAN class=kwd>As</SPAN> System.Drawing.Graphics, <SPAN class=kwd>ByVal</SPAN> x <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> y <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> width <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> height <SPAN class=kwd>As Integer</SPAN>) <SPAN class=kwd>Implements</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintScrollBox
    enhR.PaintScrollBox(g, x, y, width, height)
    <SPAN class=kwd>End Sub

    Public Sub</SPAN> PaintSheetTab(<SPAN class=kwd>ByVal</SPAN> g <SPAN class=kwd>As</SPAN> System.Drawing.Graphics, <SPAN class=kwd>ByVal</SPAN> sheet <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> text <SPAN class=kwd>As String</SPAN>, <SPAN class=kwd>ByVal</SPAN> x <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> y <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> width <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> height <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> mouseOver <SPAN class=kwd>As Boolean</SPAN>, <SPAN class=kwd>ByVal</SPAN> focused <SPAN class=kwd>As Boolean</SPAN>, <SPAN class=kwd>ByVal</SPAN> placement <SPAN class=kwd>As</SPAN> FarPoint.Win.Spread.TabStripPlacement, <SPAN class=kwd>ByVal</SPAN> isLeftToRight <SPAN class=kwd>As Boolean</SPAN>, <SPAN class=kwd>ByVal</SPAN> enabled <SPAN class=kwd>As Boolean</SPAN>, <SPAN class=kwd>ByVal</SPAN> font <SPAN class=kwd>As</SPAN> System.Drawing.Font, <SPAN class=kwd>ByVal</SPAN> activeFont <SPAN class=kwd>As</SPAN> System.Drawing.Font) <SPAN class=kwd>Implements</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintSheetTab
    enhR.PaintSheetTab(g, sheet, text, x, y, width, height, mouseOver, focused, placement, isLeftToRight, enabled, font, activeFont)
    <SPAN class=kwd>End Sub

    Public Sub</SPAN> PaintSheetTabPartial(<SPAN class=kwd>ByVal</SPAN> g <SPAN class=kwd>As</SPAN> System.Drawing.Graphics, <SPAN class=kwd>ByVal</SPAN> sheet <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> text <SPAN class=kwd>As String</SPAN>, <SPAN class=kwd>ByVal</SPAN> x <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> y <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> width <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> height <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> mouseOver <SPAN class=kwd>As Boolean</SPAN>, <SPAN class=kwd>ByVal</SPAN> focused <SPAN class=kwd>As Boolean</SPAN>, <SPAN class=kwd>ByVal</SPAN> placement <SPAN class=kwd>As</SPAN> FarPoint.Win.Spread.TabStripPlacement, <SPAN class=kwd>ByVal</SPAN> isLeftToRight <SPAN class=kwd>As Boolean</SPAN>, <SPAN class=kwd>ByVal</SPAN> enabled <SPAN class=kwd>As Boolean</SPAN>, <SPAN class=kwd>ByVal</SPAN> font <SPAN class=kwd>As</SPAN> System.Drawing.Font, <SPAN class=kwd>ByVal</SPAN> activeFont <SPAN class=kwd>As</SPAN> System.Drawing.Font) <SPAN class=kwd>Implements</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintSheetTabPartial
    enhR.PaintSheetTabPartial(g, sheet, text, x, y, width, height, mouseOver, focused, placement, isLeftToRight, enabled, font, activeFont)
    <SPAN class=kwd>End Sub

    Public Sub</SPAN> PaintSpecialSheetTab(<SPAN class=kwd>ByVal</SPAN> g <SPAN class=kwd>As</SPAN> System.Drawing.Graphics, <SPAN class=kwd>ByVal</SPAN> x <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> y <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> width <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> height <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> mouseOver <SPAN class=kwd>As Boolean</SPAN>, <SPAN class=kwd>ByVal</SPAN> placementbStrip <SPAN class=kwd>As</SPAN> FarPoint.Win.Spread.TabStripPlacement, <SPAN class=kwd>ByVal</SPAN> isLeftToRight <SPAN class=kwd>As Boolean</SPAN>, <SPAN class=kwd>ByVal</SPAN> enabled <SPAN class=kwd>As Boolean</SPAN>, <SPAN class=kwd>ByVal</SPAN> font <SPAN class=kwd>As</SPAN> System.Drawing.Font, <SPAN class=kwd>ByVal</SPAN> activeFont <SPAN class=kwd>As</SPAN> System.Drawing.Font) <SPAN class=kwd>Implements</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintSpecialSheetTab
    enhR.PaintSpecialSheetTab(g, x, y, width, height, mouseOver, placementbStrip, isLeftToRight, enabled, font, activeFont)
    <SPAN class=kwd>End Sub

    Public Sub</SPAN> PaintSplitBar(<SPAN class=kwd>ByVal</SPAN> g <SPAN class=kwd>As</SPAN> System.Drawing.Graphics, <SPAN class=kwd>ByVal</SPAN> x <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> y <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> width <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> height <SPAN class=kwd>As Integer</SPAN>) <SPAN class=kwd>Implements</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintSplitBar
    enhR.PaintSplitBar(g, x, y, width, height)
    <SPAN class=kwd>End Sub

    Public Sub</SPAN> PaintSplitBarCrossover(<SPAN class=kwd>ByVal</SPAN> g <SPAN class=kwd>As</SPAN> System.Drawing.Graphics, <SPAN class=kwd>ByVal</SPAN> x <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> y <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> width <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> height <SPAN class=kwd>As Integer</SPAN>) <SPAN class=kwd>Implements</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintSplitBarCrossover
    enhR.PaintSplitBarCrossover(g, x, y, width, height)
    <SPAN class=kwd>End Sub

    Public Sub</SPAN> PaintSplitBox(<SPAN class=kwd>ByVal</SPAN> g <SPAN class=kwd>As</SPAN> System.Drawing.Graphics, <SPAN class=kwd>ByVal</SPAN> x <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> y <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> width <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> height <SPAN class=kwd>As Integer</SPAN>) <SPAN class=kwd>Implements</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintSplitBox
    enhR.PaintSplitBox(g, x, y, width, height)
    <SPAN class=kwd>End Sub

    Public Sub</SPAN> PaintTabStripBackground(<SPAN class=kwd>ByVal</SPAN> g <SPAN class=kwd>As</SPAN> System.Drawing.Graphics, <SPAN class=kwd>ByVal</SPAN> x <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> y <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> width <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> height <SPAN class=kwd>As Integer</SPAN>, <SPAN class=kwd>ByVal</SPAN> placement <SPAN class=kwd>As</SPAN> FarPoint.Win.Spread.TabStripPlacement) <SPAN class=kwd>Implements</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintTabStripBackground
    enhR.PaintTabStripBackground(g, x, y, width, height, placement)
    <SPAN class=kwd>End Sub
    End Class</SPAN>
     
  • Replied 8 September 2017, 1:15 pm EST

    Thanks..
    I will implement that.. and post back here if i have issues.
  • Replied 8 September 2017, 1:15 pm EST

    Hi Scott,

    I put that in a test project. It worked great.
    Would you happen to have a c# version of the code?

    Thanks,
    Paresh
  • Replied 8 September 2017, 1:15 pm EST

    Paresh,


    I ran the code through a VB to C# converter (for time constraints) and have not tested this, but it looks correct.

     
    <SPAN class=kwd>public class</SPAN> myIFR : FarPoint.Win.Spread.IInterfaceRenderer 
    {

    FarPoint.Win.Spread.EnhancedInterfaceRenderer enhR = <SPAN class=kwd>new</SPAN> FarPoint.Win.Spread.EnhancedInterfaceRenderer();

    <SPAN class=kwd>public void</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintButton(System.Drawing.Graphics g, <SPAN class=kwd>int</SPAN> x, <SPAN class=kwd>int</SPAN> y, <SPAN class=kwd>int</SPAN> width, <SPAN class=kwd>int</SPAN> height, FarPoint.Win.Spread.TabStripButton button, <SPAN class=kwd>bool</SPAN> mouseOver, <SPAN class=kwd>bool</SPAN> pressed, <SPAN class=kwd>bool</SPAN> isLeftToRight, <SPAN class=kwd>bool</SPAN> enabled
    )
    {
    enhR.PaintButton(g, x, y, width, height, button, mouseOver, pressed, isLeftToRight, enabled
    );
    }

    <SPAN class=kwd>public void</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintGrayArea(System.Drawing.Graphics g, <SPAN class=kwd>int</SPAN> x, <SPAN class=kwd>int</SPAN> y, <SPAN class=kwd>int</SPAN> width, <SPAN class=kwd>int</SPAN> height)
    {
    g.DrawString(<SPAN class=st>"No Rows To Display"</SPAN>, <SPAN class=kwd>new</SPAN> Font(<SPAN class=st>"Arial"</SPAN>, 14, FontStyle.Bold), Brushes.Red, 300, 50);
    }

    <SPAN class=kwd>public void</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintRangeGroupArea(System.Drawing.Graphics g, <SPAN class=kwd>int</SPAN> x, <SPAN class=kwd>int</SPAN> y, <SPAN class=kwd>int</SPAN> width, <SPAN class=kwd>int</SPAN> height)
    {
    enhR.PaintRangeGroupArea(g, x, y, width, height);
    }

    <SPAN class=kwd>public void</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintRangeGroupButton(System.Drawing.Graphics g, <SPAN class=kwd>int</SPAN> x, <SPAN class=kwd>int</SPAN> y, <SPAN class=kwd>int</SPAN> width, <SPAN class=kwd>int</SPAN> height, FarPoint.Win.Spread.GroupState groupState, <SPAN class=kwd>bool</SPAN> rowGroup, <SPAN class=kwd>bool</SPAN> isLeftToRight)
    {
    enhR.PaintRangeGroupButton(g, x, y, width, height, groupState, rowGroup, isLeftToRight);
    }

    <SPAN class=kwd>public void</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintRangeGroupLevelBox(System.Drawing.Graphics g, <SPAN class=kwd>int</SPAN> x, <SPAN class=kwd>int</SPAN> y, <SPAN class=kwd>int</SPAN> width, <SPAN class=kwd>int</SPAN> height, <SPAN class=kwd>int</SPAN> groupLevel, <SPAN class=kwd>bool</SPAN> rowGroup, <SPAN class=kwd>bool</SPAN> isLeftToRight)
    {
    enhR.PaintRangeGroupLevelBox(g, x, y, width, height, groupLevel, rowGroup, isLeftToRight);
    }

    <SPAN class=kwd>public void</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintRangeGroupLine(System.Drawing.Graphics g, System.Drawing.Point startPoint, System.Drawing.Point endPoint)
    {
    enhR.PaintRangeGroupLine(g, startPoint, endPoint);
    }

    <SPAN class=kwd>public void</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintRangeGroupPoint(System.Drawing.Graphics g, System.Drawing.Point point)
    {
    enhR.PaintRangeGroupPoint(g, point);
    }

    <SPAN class=kwd>public void</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintScrollBox(System.Drawing.Graphics g, <SPAN class=kwd>int</SPAN> x, <SPAN class=kwd>int</SPAN> y, <SPAN class=kwd>int</SPAN> width, <SPAN class=kwd>int</SPAN> height)
    {
    enhR.PaintScrollBox(g, x, y, width, height);
    }

    <SPAN class=kwd>public void</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintSheetTab(System.Drawing.Graphics g, <SPAN class=kwd>int</SPAN> sheet, <SPAN class=kwd>string</SPAN> text, <SPAN class=kwd>int</SPAN> x, <SPAN class=kwd>int</SPAN> y, <SPAN class=kwd>int</SPAN> width, <SPAN class=kwd>int</SPAN> height, <SPAN class=kwd>bool</SPAN> mouseOver, <SPAN class=kwd>bool</SPAN> focused, FarPoint.Win.Spread.TabStripPlacement placement,
    <SPAN class=kwd>bool</SPAN> isLeftToRight, <SPAN class=kwd>bool</SPAN> enabled, System.Drawing.Font font, System.Drawing.Font activeFont)
    {
    enhR.PaintSheetTab(g, sheet, text, x, y, width, height, mouseOver, focused, placement,
    isLeftToRight, enabled, font, activeFont);
    }

    <SPAN class=kwd>public void</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintSheetTabPartial(System.Drawing.Graphics g, <SPAN class=kwd>int</SPAN> sheet, <SPAN class=kwd>string</SPAN> text, <SPAN class=kwd>int</SPAN> x, <SPAN class=kwd>int</SPAN> y, <SPAN class=kwd>int</SPAN> width, <SPAN class=kwd>int</SPAN> height, <SPAN class=kwd>bool</SPAN> mouseOver, <SPAN class=kwd>bool</SPAN> focused, FarPoint.Win.Spread.TabStripPlacement placement,
    <SPAN class=kwd>bool</SPAN> isLeftToRight, <SPAN class=kwd>bool</SPAN> enabled, System.Drawing.Font font, System.Drawing.Font activeFont)
    {
    enhR.PaintSheetTabPartial(g, sheet, text, x, y, width, height, mouseOver, focused, placement,
    isLeftToRight, enabled, font, activeFont);
    }

    <SPAN class=kwd>public void</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintSpecialSheetTab(System.Drawing.Graphics g, <SPAN class=kwd>int</SPAN> x, <SPAN class=kwd>int</SPAN> y, <SPAN class=kwd>int</SPAN> width, <SPAN class=kwd>int</SPAN> height, <SPAN class=kwd>bool</SPAN> mouseOver, FarPoint.Win.Spread.TabStripPlacement placementbStrip, <SPAN class=kwd>bool</SPAN> isLeftToRight, <SPAN class=kwd>bool</SPAN> enabled, System.Drawing.Font font,
    System.Drawing.Font activeFont)
    {
    enhR.PaintSpecialSheetTab(g, x, y, width, height, mouseOver, placementbStrip, isLeftToRight, enabled, font,
    activeFont);
    }

    <SPAN class=kwd>public void</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintSplitBar(System.Drawing.Graphics g, <SPAN class=kwd>int</SPAN> x, <SPAN class=kwd>int</SPAN> y, <SPAN class=kwd>int</SPAN> width, <SPAN class=kwd>int</SPAN> height)
    {
    enhR.PaintSplitBar(g, x, y, width, height);
    }

    <SPAN class=kwd>public void</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintSplitBarCrossover(System.Drawing.Graphics g, <SPAN class=kwd>int</SPAN> x, <SPAN class=kwd>int</SPAN> y, <SPAN class=kwd>int</SPAN> width, <SPAN class=kwd>int</SPAN> height)
    {
    enhR.PaintSplitBarCrossover(g, x, y, width, height);
    }

    <SPAN class=kwd>public void</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintSplitBox(System.Drawing.Graphics g, <SPAN class=kwd>int</SPAN> x, <SPAN class=kwd>int</SPAN> y, <SPAN class=kwd>int</SPAN> width, <SPAN class=kwd>int</SPAN> height)
    {
    enhR.PaintSplitBox(g, x, y, width, height);
    }

    <SPAN class=kwd>public void</SPAN> FarPoint.Win.Spread.IInterfaceRenderer.PaintTabStripBackground(System.Drawing.Graphics g, <SPAN class=kwd>int</SPAN> x, <SPAN class=kwd>int</SPAN> y, <SPAN class=kwd>int</SPAN> width, <SPAN class=kwd>int</SPAN> height, FarPoint.Win.Spread.TabStripPlacement placement)
    {
    enhR.PaintTabStripBackground(g, x, y, width, height, placement);
    }
    }
     
  • Replied 8 September 2017, 1:15 pm EST

    Thanks for the code..

    I am having a problem. I have the following code in the PaintGrayArea function.
    After I click a button , I set the SpreadStatus to SpreadMessageStatus.Processing. and then i show MessageBox  with yes no buttons. if you click no ,then i set the status to RequestCanceled.
    I have attached a screen shot of the problem." processed.Please wait" from the previous message is still there.



                renderer.PaintGrayArea(g, x, y, width, height);
                string message=null;
                Brush brush = Brushes.SeaGreen;
                switch (this.SpreadStatus)
                {
                    case SpreadMessageStatus.Custom:
                        message = this.CustomMessage;
                        break;
                    case SpreadMessageStatus.NoRowsFound:
                        message = "No Records Found";
                        brush = Brushes.Red;
                        break;
                    case SpreadMessageStatus.Processing:
                        message = "This request is being processed.Please wait";
                        break;
                    case SpreadMessageStatus.RequestCanceled:
                        message = "The last request was cancelled.";
                        break;
                    case SpreadMessageStatus.NoMessage:
                        message = "";
                        break;
                    default:
                        message = "";
                        break;
                }

                if (this.Spread.ActiveSheet.RowCount == 0)
                    g.DrawString(message, new Font("Arial", 12, FontStyle.Bold), brush, 250, 50);

    <img alt="">

    2008/05/cancelled.JPG
  • Replied 8 September 2017, 1:15 pm EST

    Hello,


    Are you redrawing the grayarea after the messagebox? This should get rid of the first message.

  • Replied 8 September 2017, 1:15 pm EST

    Thanks.I called spread.refresh() and it worked.
    Is that what you meant by redrawing or did you mean some otherway?

  • Replied 8 September 2017, 1:15 pm EST

    Hello,


    Calling the Refresh method will cause all visible areas to repaint, so this will repaint the area. I did not know when the MessageBox was show and the message was updated. I wanted to make sure you call the renderer.PaintGrayArea method to repaint the gray area before the new text. The Refresh method will work.

Need extra support?

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

Learn More

Forum Channels