Page 1 of 1

How should I set modal propery to false

Posted: Sat Sep 01, 2007 7:05 am
by satisht
I have shown form as
Using form As Stimulsoft.Report.Render.StiPreviewForm = New Stimulsoft.Report.Render.StiPreviewForm(Report)
Dim stiPreview As Stimulsoft.Report.Render.StiPreviewControl = form.PreviewControl
Dim tb As StiToolBar = stiPreview.ToolBar
Dim btnSave As StiToolButton = TryCast(tb.Controls.Item("tbSave"), StiToolButton)
Dim btnExport As StiToolButton = TryCast(tb.Controls.Item("tbExport"), StiToolButton)
btnExport.Image = btnSave.Image
Report.Compile()
Report.Render()
form.ShowDialog()
End using
So how should i set modal propery false, it is read only , if I use form.show then form gets closed automaticall?
what will be the solution?

How should I set modal propery to false

Posted: Sat Sep 01, 2007 9:35 am
by Brendan
The reason your preview window is closing after calling show is because you have your preview form in a Using code block. this means that after the Show(), your code exits the Using block and it automatically disposes the preview form for you.
When you show Dialog forms in your application it is best practice to dispose of them once they close.
However since you need to show the preview form in a non modal fashion you should try this code:

Code: Select all

Dim form As New Stimulsoft.Report.Render.StiPreviewForm(Report)
Dim stiPreview As Stimulsoft.Report.Render.StiPreviewControl = form.PreviewControl
Dim tb As StiToolBar = stiPreview.ToolBar
Dim btnSave As StiToolButton = TryCast(tb.Controls.Item("tbSave"), StiToolButton)
Dim btnExport As StiToolButton = TryCast(tb.Controls.Item("tbExport"), StiToolButton)
btnExport.Image = btnSave.Image
Report.Compile()
Report.Render()
form.Show()

How should I set modal propery to false

Posted: Mon Sep 03, 2007 1:20 am
by satisht
Thank You.