Add button in StiVewContro toolbar-need the same style

Stimulsoft Reports.NET discussion
Post Reply
mrapi
Posts: 282
Joined: Sat Dec 20, 2008 1:08 am

Add button in StiVewContro toolbar-need the same style

Post by mrapi »

Hi !,I've searched on the forum and found how to add new button on toolbar for StiVewControl ,we need to add a button for launch system calculator,all works fine except that new button looks different as style as other buttons on the toolbar,see the image :
Image
I need just the same style.
Thanks !
mrapi
Posts: 282
Joined: Sat Dec 20, 2008 1:08 am

Re: Add button in StiVewContro toolbar-need the same style

Post by mrapi »

code used :

Code: Select all

 Dim myButton1 As New Stimulsoft.Controls.StiButton
       myButton1.Image = My.Resources.Resources.calculator
    
        myButton1.Width = 30
        myButton1.Left = 550

        AddHandler myButton1.Click, AddressOf btCalc_Click
        stViewCtrl.ToolBar.Controls.Add(myButton1)
Also i'm interesting for some other solution to this problem : to change one of existing buttons (NewPage for example that I don't use it) and to change image and the event handler.

Thanks !
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Add button in StiVewContro toolbar-need the same style

Post by HighAley »

Hello.
mrapi wrote:code used :

Code: Select all

 Dim myButton1 As New Stimulsoft.Controls.StiButton
       myButton1.Image = My.Resources.Resources.calculator
    
        myButton1.Width = 30
        myButton1.Left = 550

        AddHandler myButton1.Click, AddressOf btCalc_Click
        stViewCtrl.ToolBar.Controls.Add(myButton1)
You use the wrong button. Here is our code of creating Find button:

Code: Select all

public ButtonItem tbFind;
tbFind.Text = StiHint.CreateHint(StiLocalization.Get("FormViewer", "Find"));
tbFind.Shortcuts.Clear();
this.tbFind = new Stimulsoft.Controls.Win.DotNetBar.ButtonItem();
this.tbFind.BeginGroup = true;
this.tbFind.Image = global::Stimulsoft.Report.Win.Properties.Resources.Find;
this.tbFind.ImageIndex = 20;
this.tbFind.Name = "tbFind";
this.tbFind.PopupPositionAdjusted = false;
this.tbFind.Shortcuts.Add(Stimulsoft.Controls.Win.DotNetBar.eShortcut.CtrlF);
this.tbFind.Text = "Find...";
this.tbFind.Click += new System.EventHandler(this.tbToolFind_Click);
mrapi wrote:Also i'm interesting for some other solution to this problem : to change one of existing buttons (NewPage for example that I don't use it) and to change image and the event handler.
To change an existing button you could find it in the StiViewerControl.ToolBar.Items collection.

Thank you.
mrapi
Posts: 282
Joined: Sat Dec 20, 2008 1:08 am

Re: Add button in StiVewContro toolbar-need the same style

Post by mrapi »

Thanks you very much for your answer !!!
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Re: Add button in StiVewContro toolbar-need the same style

Post by Andrew »

Hello,

We are glad to help you!

Thank you.
Post Reply