For translation purpose , i want to change the to tooltip,caption and title of the PrintPreview and Print window

Posted by: leomathew on 8 September 2017, 12:29 pm EST

  • Posted 8 September 2017, 12:29 pm EST

    For translation purpose , i want to change the to tooltip,caption and title of the PrintPreview and Print window.


    Can you tell me is it possible in Farpoint.

  • Replied 8 September 2017, 12:29 pm EST

    Hello,


    The tooltip text, captions for the headers, and the PrintPreview dialog caption can all be modified by you programatically; the PrintPreview control only if you have the latest 2.5 version of the product. Spread does not automatically translate strings, you would need to do this programatically.

  • Replied 8 September 2017, 12:29 pm EST

    Hello,


    This is all the controls in the PrintPreview dialog. What control are you not able to get? If you want to change the caption for the dialog, you can set the Text property on the PrintPreviewDialog control.

     
      Private Sub FpSpread1_PrintPreviewShowing(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.PrintPreviewShowingEventArgs) Handles FpSpread1.PrintPreviewShowing
    e.PreviewDialog.Text = "This is my test"
    End Sub
     
  • Replied 8 September 2017, 12:29 pm EST

     In the PrintPreview window there are controls like Print/Zoom/different number of page icons(based on how many pages available),Close and Page control that shows the number of pages in the combobox.


    (1)I want to change the tooltip of  "Print/Zoom/different number of page icons(based on how many pages available),Close" .


    (2)I have to change the label of Page control the same way the title of the PrintPreview window is changed.The label 'Page' need to be translated.


    All this is needed since our application would need to localised for German and other languages.


    How can i get these controls , so i can change the tooltip.


     


     

  • Replied 8 September 2017, 12:29 pm EST

    Hello,


    These controls are part of the ToolStrip object that you got on the dialog. You need to look at documentation for this class to find out how to get at each of the buttons to change the tooltip.

  • Replied 8 September 2017, 12:29 pm EST

    Can you tell me where can i get the documentation for these new features.
  • Replied 8 September 2017, 12:29 pm EST

    I am using the Farpoint version 2.5.2003.2005.


    This is the code i am using to display the print preview window or print the Farpoint spread.


    private void PrintSheet(bool preview)
    {
        private FarPoint.Win.Spread.PrintInfo _printInfo;


        this._printInfo.ShowPrintDialog = true;
        this._printInfo.Preview = preview;
        this._printInfo.Footer = DataConstants.PrintFooterStyle;
        this._printInfo.Header = DataConstants.PrintHeaderStyle + this.ParentForm.Text;
        this._newSheet.PrintInfo = this._printInfo;
        this._gridSpreadView.PrintSheet(this._newSheet);
    }


    I do not know how can i get access to the print preview window and change it once i use the above.


     




     


     




  • Replied 8 September 2017, 12:29 pm EST

    Hello,


    There is a PrintPreviewShowing event that fires as the preview control is being created. You can catch this event and get the control.

  • Replied 8 September 2017, 12:29 pm EST

    Hi Scott,


     I am still not able to get the controls of the PrintPreview Dialog box.


    I used the following line in the constructor to catch the event.


    _gridSpreadView.PrintPreviewShowing += new FarPoint.Win.Spread.PrintPreviewShowingEventHandler(this.GetPrintPreviewButtons);


    The above event is linked to the below method where i get the PreviewDialog and PreviewControl.





     public void GetPrintPreviewButtons(object sender, PrintPreviewShowingEventArgs e)
    {
        PrintPreviewControl c = e.PreviewControl;
        PrintPreviewDialog d = e.PreviewDialog;


        MessageBox.Show("Control Count :" + e.PreviewControl.Controls.Count.ToString());//Return 0
        MessageBox.Show("Dialog Count :" + e.PreviewDialog.Controls.Count.ToString());//Returns only 2


        MessageBox.Show(d.Controls[1].Controls[0].Name.ToString());


     }


    I am able to get only 2 controls from the PrintPreviewDialog.(1)Toolstrip (2)Pagecounter.


    Could you tell me is this the right way to go about or to get all the controls in PrintPreview control ,i need to do something else.


     



     


     

  • Replied 8 September 2017, 12:29 pm EST

    Hello,


    This is documented in the Visual Studio Help.

Need extra support?

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

Learn More

Forum Channels