5 Replies - 637 Views - Last Post: 10 November 2011 - 01:12 PM Rate Topic: -----

#1 naveed_786  Icon User is offline

  • D.I.C Regular

Reputation: 0
  • View blog
  • Posts: 306
  • Joined: 13-October 09

VB.NET Form Problem

Posted 02 September 2011 - 05:31 AM

Hello Dear All,

I have problem with my form in VB.NET application

Actually i have a form on this form i have added a crystal report previewer as you can see in attached image,
now the problem is this when i run the application and view the report successfully and click on cross(x) button
it closes the form but i just want to close the "crystal report previewer" so that i should be able to pass another parameter to view the report again but now the situation is this when i click on the cross button it closes the form can anybody give me idea how can i avoid this and also view the image i have circled the another problem i want to close this tree permanently.

Thanks in advance.

Attached image(s)

  • Attached Image


Is This A Good Question/Topic? 0
  • +

Replies To: VB.NET Form Problem

#2 hlx  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 31
  • View blog
  • Posts: 135
  • Joined: 13-November 10

Re: VB.NET Form Problem

Posted 02 September 2011 - 05:39 AM

Hello there, show us what you have done so far, and we will try and spot any issues for you!
Was This Post Helpful? 0
  • +
  • -

#3 naveed_786  Icon User is offline

  • D.I.C Regular

Reputation: 0
  • View blog
  • Posts: 306
  • Joined: 13-October 09

Re: VB.NET Form Problem

Posted 02 September 2011 - 05:44 AM

i have two buttons on this form as you can see in attached image on forms run time i have wrote these lines of code

btnrep.visible = False
btnexit.visible = False

now when form runs the both buttons hides but i didn't have any option to close the report previewer so i just click on cross button it closes the form and the main menu form comes on screen.
Was This Post Helpful? -1
  • +
  • -

#4 naveed_786  Icon User is offline

  • D.I.C Regular

Reputation: 0
  • View blog
  • Posts: 306
  • Joined: 13-October 09

Re: VB.NET Form Problem

Posted 10 September 2011 - 09:20 PM

no body has any idea if you didn't understand me let me more specific is there any way so that i should be able to close the crystal report viewer.
Was This Post Helpful? -1
  • +
  • -

#5 naveed_786  Icon User is offline

  • D.I.C Regular

Reputation: 0
  • View blog
  • Posts: 306
  • Joined: 13-October 09

Re: VB.NET Form Problem

Posted 11 September 2011 - 01:16 AM

The issue has been resolved here is the solution

CrystalReportViewer1.ReportSource = Nothing

Was This Post Helpful? 1
  • +
  • -

#6 DimitriV  Icon User is offline

  • They don't think it be like it is, but it do
  • member icon

Reputation: 584
  • View blog
  • Posts: 2,738
  • Joined: 24-July 11

Re: VB.NET Form Problem

Posted 10 November 2011 - 01:12 PM

Hi, i know this is an old post but maybe you could do this, just a conditional form closing event.
If CrystalReportViewer1.ReportSource = Nothing Then 'check if its already nothing
'Let the form close as there is nothing open
Else 'there's a report open
CrystalReportViewer1.ReportSource = Nothing
E.Cancel = True
End If


That's just an idea I had when I found this thread and I thought I'd share it with you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1