Home All Groups Group Topic Archive Search About

Premature Ending of App

Author
27 Dec 2006 11:02 AM
Paul Ilacqua
I have a single form VB.NET program that prints some data using
PrintDocument class. The problem is when I preview the document and then
close the preview... it exits the application. I have 2 versions of the
program 1 that exits and 1 that doesn't. I've scoured the properties of the
calling form and sure I can't find where the issue could be.
I appreciate any light someone could shed on where to begin.

Paul

Author
27 Dec 2006 11:19 AM
Cor Ligthert [MVP]
Paul,

How many forms do you use and what is the purpose of those.

Cor

Show quoteHide quote
"Paul Ilacqua" <pilac***@twcny.rr.com> schreef in bericht
news:%23$9bGaaKHHA.2456@TK2MSFTNGP06.phx.gbl...
>I have a single form VB.NET program that prints some data using
>PrintDocument class. The problem is when I preview the document and then
>close the preview... it exits the application. I have 2 versions of the
>program 1 that exits and 1 that doesn't. I've scoured the properties of the
>calling form and sure I can't find where the issue could be.
> I appreciate any light someone could shed on where to begin.
>
> Paul
>
Author
27 Dec 2006 1:24 PM
Paul Ilacqua
Cor,
  It's a single form app that contains a Datagrid for display of Data then
the "report Button" builds a string & the report. The odd thing is I have
another version of this that works OK when I close the report preview the
app stays open.
What tells the app to close when a report preview or any other form is
closed?
Thanks for the response.

Paul



Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:OyIwDiaKHHA.5000@TK2MSFTNGP03.phx.gbl...
> Paul,
>
> How many forms do you use and what is the purpose of those.
>
> Cor
>
> "Paul Ilacqua" <pilac***@twcny.rr.com> schreef in bericht
> news:%23$9bGaaKHHA.2456@TK2MSFTNGP06.phx.gbl...
>>I have a single form VB.NET program that prints some data using
>>PrintDocument class. The problem is when I preview the document and then
>>close the preview... it exits the application. I have 2 versions of the
>>program 1 that exits and 1 that doesn't. I've scoured the properties of
>>the calling form and sure I can't find where the issue could be.
>> I appreciate any light someone could shed on where to begin.
>>
>> Paul
>>
>
>
Author
27 Dec 2006 3:16 PM
Cor Ligthert [MVP]
Paul,

And is the report preview on an other form
(check if that is showed with show or with showdialog on both applications
then)

Cor

Show quoteHide quote
"Paul Ilacqua" <pilac***@twcny.rr.com> schreef in bericht
news:ePb3VpbKHHA.4000@TK2MSFTNGP06.phx.gbl...
> Cor,
>  It's a single form app that contains a Datagrid for display of Data then
> the "report Button" builds a string & the report. The odd thing is I have
> another version of this that works OK when I close the report preview the
> app stays open.
> What tells the app to close when a report preview or any other form is
> closed?
> Thanks for the response.
>
> Paul
>
>
>
> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
> news:OyIwDiaKHHA.5000@TK2MSFTNGP03.phx.gbl...
>> Paul,
>>
>> How many forms do you use and what is the purpose of those.
>>
>> Cor
>>
>> "Paul Ilacqua" <pilac***@twcny.rr.com> schreef in bericht
>> news:%23$9bGaaKHHA.2456@TK2MSFTNGP06.phx.gbl...
>>>I have a single form VB.NET program that prints some data using
>>>PrintDocument class. The problem is when I preview the document and then
>>>close the preview... it exits the application. I have 2 versions of the
>>>program 1 that exits and 1 that doesn't. I've scoured the properties of
>>>the calling form and sure I can't find where the issue could be.
>>> I appreciate any light someone could shed on where to begin.
>>>
>>> Paul
>>>
>>
>>
>
>
Author
27 Dec 2006 9:35 PM
Paul Ilacqua
Cor,
   The report buttons call the same class that runs the .ShowDialog(),
that's why it seems to be in the calling form's settings somewhere? Both
form's command buttons are calling the same class in the same way but one
closes the app and 1 doesn't.
The form is pretty complex or I would just recreate it. I'm going to try a
fresh button and see what happens.


"Cor Ligthert [MVP]" <notmyfirstn***@planet.nle app and 1 doesnt
Show quoteHide quote
wrote in message news:%23hNg7mcKHHA.448@TK2MSFTNGP04.phx.gbl...
> Paul,
>
> And is the report preview on an other form
> (check if that is showed with show or with showdialog on both applications
> then)
>
> Cor
>
> "Paul Ilacqua" <pilac***@twcny.rr.com> schreef in bericht
> news:ePb3VpbKHHA.4000@TK2MSFTNGP06.phx.gbl...
>> Cor,
>>  It's a single form app that contains a Datagrid for display of Data then
>> the "report Button" builds a string & the report. The odd thing is I have
>> another version of this that works OK when I close the report preview the
>> app stays open.
>> What tells the app to close when a report preview or any other form is
>> closed?
>> Thanks for the response.
>>
>> Paul
>>
>>
>>
>> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
>> news:OyIwDiaKHHA.5000@TK2MSFTNGP03.phx.gbl...
>>> Paul,
>>>
>>> How many forms do you use and what is the purpose of those.
>>>
>>> Cor
>>>
>>> "Paul Ilacqua" <pilac***@twcny.rr.com> schreef in bericht
>>> news:%23$9bGaaKHHA.2456@TK2MSFTNGP06.phx.gbl...
>>>>I have a single form VB.NET program that prints some data using
>>>>PrintDocument class. The problem is when I preview the document and then
>>>>close the preview... it exits the application. I have 2 versions of the
>>>>program 1 that exits and 1 that doesn't. I've scoured the properties of
>>>>the calling form and sure I can't find where the issue could be.
>>>> I appreciate any light someone could shed on where to begin.
>>>>
>>>> Paul
>>>>
>>>
>>>
>>
>>
>
>
Author
27 Dec 2006 10:07 PM
Paul Ilacqua
Cor....
  I recreated the calling button and it worked fine.... Now I'll never know
why, but it's fixed. Thanks for your help.....
Paul
Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:%23hNg7mcKHHA.448@TK2MSFTNGP04.phx.gbl...
> Paul,
>
> And is the report preview on an other form
> (check if that is showed with show or with showdialog on both applications
> then)
>
> Cor
>
> "Paul Ilacqua" <pilac***@twcny.rr.com> schreef in bericht
> news:ePb3VpbKHHA.4000@TK2MSFTNGP06.phx.gbl...
>> Cor,
>>  It's a single form app that contains a Datagrid for display of Data then
>> the "report Button" builds a string & the report. The odd thing is I have
>> another version of this that works OK when I close the report preview the
>> app stays open.
>> What tells the app to close when a report preview or any other form is
>> closed?
>> Thanks for the response.
>>
>> Paul
>>
>>
>>
>> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
>> news:OyIwDiaKHHA.5000@TK2MSFTNGP03.phx.gbl...
>>> Paul,
>>>
>>> How many forms do you use and what is the purpose of those.
>>>
>>> Cor
>>>
>>> "Paul Ilacqua" <pilac***@twcny.rr.com> schreef in bericht
>>> news:%23$9bGaaKHHA.2456@TK2MSFTNGP06.phx.gbl...
>>>>I have a single form VB.NET program that prints some data using
>>>>PrintDocument class. The problem is when I preview the document and then
>>>>close the preview... it exits the application. I have 2 versions of the
>>>>program 1 that exits and 1 that doesn't. I've scoured the properties of
>>>>the calling form and sure I can't find where the issue could be.
>>>> I appreciate any light someone could shed on where to begin.
>>>>
>>>> Paul
>>>>
>>>
>>>
>>
>>
>
>
Author
28 Dec 2006 5:04 PM
Chris Dunaway
Paul Ilacqua wrote:
> Cor....
>   I recreated the calling button and it worked fine.... Now I'll never know
> why, but it's fixed. Thanks for your help.....
> Paul

Check the Forms AcceptButton and CancelButton properties and also check
the DialogResult property of the button that causes it to close.

Chris
Author
29 Dec 2006 1:01 AM
Kimera.Kimera
Paul Ilacqua wrote:
Show quoteHide quote
> Cor....
>   I recreated the calling button and it worked fine.... Now I'll never know
> why, but it's fixed. Thanks for your help.....
> Paul
> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
> news:%23hNg7mcKHHA.448@TK2MSFTNGP04.phx.gbl...
> > Paul,
> >
> > And is the report preview on an other form
> > (check if that is showed with show or with showdialog on both applications
> > then)
> >
> > Cor
> >
> > "Paul Ilacqua" <pilac***@twcny.rr.com> schreef in bericht
> > news:ePb3VpbKHHA.4000@TK2MSFTNGP06.phx.gbl...
> >> Cor,
> >>  It's a single form app that contains a Datagrid for display of Data then
> >> the "report Button" builds a string & the report. The odd thing is I have
> >> another version of this that works OK when I close the report preview the
> >> app stays open.
> >> What tells the app to close when a report preview or any other form is
> >> closed?
> >> Thanks for the response.
> >>
> >> Paul
> >>
> >>
> >>
> >> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
> >> news:OyIwDiaKHHA.5000@TK2MSFTNGP03.phx.gbl...
> >>> Paul,
> >>>
> >>> How many forms do you use and what is the purpose of those.
> >>>
> >>> Cor
> >>>
> >>> "Paul Ilacqua" <pilac***@twcny.rr.com> schreef in bericht
> >>> news:%23$9bGaaKHHA.2456@TK2MSFTNGP06.phx.gbl...
> >>>>I have a single form VB.NET program that prints some data using
> >>>>PrintDocument class. The problem is when I preview the document and then
> >>>>close the preview... it exits the application. I have 2 versions of the
> >>>>program 1 that exits and 1 that doesn't. I've scoured the properties of
> >>>>the calling form and sure I can't find where the issue could be.
> >>>> I appreciate any light someone could shed on where to begin.
> >>>>
> >>>> Paul
> >>>>
> >>>
> >>>
> >>
> >>
> >
> >

I think a possible reason for this could be:

When you call a form such as Form1.Showdialog, the code is paused from
where it was ran from, eg.

Me.hide()
Form1.Showdialog()
Me.close()

In this code the procedure would be paused at the line of
Form1.Showdialog()

However, the code will be resumed if the instance of Form1 is closed,
so Me.Close will happen, along with the rest of the procedure.
Author
29 Dec 2006 5:05 AM
Cor Ligthert [MVP]
Kimera,

I think the most possible problem is as Chris wrote, there has been a bug in
the OK and Cancel button part of the form class. I don't know if it is
already fixed.

Cor

<Kimera.Kim***@gmail.com> schreef in bericht
Show quoteHide quote
news:1167354088.762091.144570@i12g2000cwa.googlegroups.com...
>
> Paul Ilacqua wrote:
>> Cor....
>>   I recreated the calling button and it worked fine.... Now I'll never
>> know
>> why, but it's fixed. Thanks for your help.....
>> Paul
>> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
>> news:%23hNg7mcKHHA.448@TK2MSFTNGP04.phx.gbl...
>> > Paul,
>> >
>> > And is the report preview on an other form
>> > (check if that is showed with show or with showdialog on both
>> > applications
>> > then)
>> >
>> > Cor
>> >
>> > "Paul Ilacqua" <pilac***@twcny.rr.com> schreef in bericht
>> > news:ePb3VpbKHHA.4000@TK2MSFTNGP06.phx.gbl...
>> >> Cor,
>> >>  It's a single form app that contains a Datagrid for display of Data
>> >> then
>> >> the "report Button" builds a string & the report. The odd thing is I
>> >> have
>> >> another version of this that works OK when I close the report preview
>> >> the
>> >> app stays open.
>> >> What tells the app to close when a report preview or any other form is
>> >> closed?
>> >> Thanks for the response.
>> >>
>> >> Paul
>> >>
>> >>
>> >>
>> >> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
>> >> news:OyIwDiaKHHA.5000@TK2MSFTNGP03.phx.gbl...
>> >>> Paul,
>> >>>
>> >>> How many forms do you use and what is the purpose of those.
>> >>>
>> >>> Cor
>> >>>
>> >>> "Paul Ilacqua" <pilac***@twcny.rr.com> schreef in bericht
>> >>> news:%23$9bGaaKHHA.2456@TK2MSFTNGP06.phx.gbl...
>> >>>>I have a single form VB.NET program that prints some data using
>> >>>>PrintDocument class. The problem is when I preview the document and
>> >>>>then
>> >>>>close the preview... it exits the application. I have 2 versions of
>> >>>>the
>> >>>>program 1 that exits and 1 that doesn't. I've scoured the properties
>> >>>>of
>> >>>>the calling form and sure I can't find where the issue could be.
>> >>>> I appreciate any light someone could shed on where to begin.
>> >>>>
>> >>>> Paul
>> >>>>
>> >>>
>> >>>
>> >>
>> >>
>> >
>> >
>
> I think a possible reason for this could be:
>
> When you call a form such as Form1.Showdialog, the code is paused from
> where it was ran from, eg.
>
> Me.hide()
> Form1.Showdialog()
> Me.close()
>
> In this code the procedure would be paused at the line of
> Form1.Showdialog()
>
> However, the code will be resumed if the instance of Form1 is closed,
> so Me.Close will happen, along with the rest of the procedure.
>