PreviewControl Close button
Hi.
I have the PreviewControl in a TabControl, and when I close the PreviewControl, I want to open/show another tab when i click the Close button, but it close the program.
Is there a way to give that Close button another comand or do i need the Pro version og the FR.NET?
Thanks for the help.
Best regards from
Ken
I have the PreviewControl in a TabControl, and when I close the PreviewControl, I want to open/show another tab when i click the Close button, but it close the program.
Is there a way to give that Close button another comand or do i need the Pro version og the FR.NET?
Thanks for the help.
Best regards from
Ken
Comments
The "Close" button closes the current form. You may disable the standard Close button and add own button that does what you need:
using DevComponents.DotNetBar;
ButtonItem customButton = new ButtonItem();
customButton.Text = "my button";
customButton.Click += new EventHandler(customButton_Click);
previewControl1.ToolBar.Items.Add(customButton);
hmmmmmm...... i did not get that to work, and i am using VB.NET and DevComponents.
I am new to VB.NET and FR [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> So if the is some diference in the programming, i will be happy for the help[/img][img]style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> Thanks for the help. Ken[/img]
Imports DevComponents.DotNetBar
Dim customButton As ButtonItem = New ButtonItem
customButton.Text = "my button"
AddHandler customButton.Click, AddressOf customButton_Click
previewControl1.ToolBar.Items.Add(customButton)
When i did that, i got a problem with the ButtonItem that i have put i line under.
It say that ButtonItem is ambiguous in the namspace DevComponents.DotNetBar.
I dont have the source code, do i need that for this?
I dont know what i am doing wrong her now, but i think i have to try something else. [img]style_emoticons/<#EMO_DIR#>/dry.gif" style="vertical-align:middle" emoid="<_<" border="0" alt="dry.gif" /> Dim customButton As[/img]ButtonItem = New ButtonItem
customButton.Text = "my button"
AddHandler customButton.Click, AddressOf customButton_Click
PreviewControl1.ToolBar.Items.Add(customButton)
Thanks for the help.
Ken
Dim customButton As DevComponents.DotNetBar.ButtonItem = New DevComponents.DotNetBar.ButtonItem
And i have startet a new form, and only have the PreviewControl and DotNetBarManager there, but stil the same :-(
The solution is to move all reporting logic into a separate dll that uses FastReport.dll and FastReport.Bars.dll only, and reference this dll in your program. Since this dll will not use DevComponents, you will be able to do what I wrote before.
Now it works grate.
Thanks for quick respond, this is what i call good service.
Best regards
Ken