Page 1 of 1
Add button in StiVewContro toolbar-need the same style
Posted: Mon Aug 20, 2012 12:26 pm
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 :

I need just the same style.
Thanks !
Re: Add button in StiVewContro toolbar-need the same style
Posted: Mon Aug 20, 2012 4:17 pm
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 !
Re: Add button in StiVewContro toolbar-need the same style
Posted: Tue Aug 21, 2012 11:07 am
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.
Re: Add button in StiVewContro toolbar-need the same style
Posted: Wed Aug 22, 2012 5:54 am
by mrapi
Thanks you very much for your answer !!!
Re: Add button in StiVewContro toolbar-need the same style
Posted: Thu Aug 23, 2012 3:34 am
by Andrew
Hello,
We are glad to help you!
Thank you.