473,325 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

showdialog and return values

Hi folks,

Don't know how to get info about the second dialog which appears after
clicking a button of the first dialog.

following situation:

Dim saveMode As Boolean
Dim saveFileDialog1 As New SaveFileDialog()

' if I clicking the ok button, set value true, pdfreport will be created

If (saveFileDialog1.ShowDialog() = DialogResult.OK) Then
saveMode = True
Else
saveMode = False
End If

for the first time running this it works fine. The next time I start and
click the ok button a new dialog appears with a message "File already
exists, Override Yes/No". After clicking yes the programm runs on at the
else mode, so the saveMode var is set to false.

How can I ask for return values of the second dialog? Any idea?

Joerg
--
Email: Jo****************@IndustrieHansa.de
ex***********************@volkswagen.de

Nov 20 '05 #1
16 9079
Cor
Hi Joerg,

I did look very long, but I only see one showdialog.

Is there something missing in your message or am I seeing something not (not
impossible)?.

Cor

Dim saveMode As Boolean
Dim saveFileDialog1 As New SaveFileDialog()

' if I clicking the ok button, set value true, pdfreport will be created

If (saveFileDialog1.ShowDialog() = DialogResult.OK) Then
saveMode = True
Else
saveMode = False
End If

Nov 20 '05 #2
Hello Cor,

the second dialog I mean appears automatically by system (dialog - "File
already exists ... Override Yes/no")

Joerg

"Cor" <no*@non.com> schrieb im Newsbeitrag
news:O$**************@TK2MSFTNGP09.phx.gbl...
Hi Joerg,

I did look very long, but I only see one showdialog.

Is there something missing in your message or am I seeing something not (not impossible)?.

Cor

Dim saveMode As Boolean
Dim saveFileDialog1 As New SaveFileDialog()

' if I clicking the ok button, set value true, pdfreport will be created

If (saveFileDialog1.ShowDialog() = DialogResult.OK) Then
saveMode = True
Else
saveMode = False
End If


Nov 20 '05 #3
Cor
Hi Joerg,

Do you if you restart the program the same effect when you select an already
existing file?

I did never test this, but I am thinking about something that the pdf file
is not yet closed, so it cannot be overwritten.

Cor
Nov 20 '05 #4
* "Joerg Trumpfheller" <ex***********************@volkswagen.de> scripsit:
Don't know how to get info about the second dialog which appears after
clicking a button of the first dialog.

following situation:

Dim saveMode As Boolean
Dim saveFileDialog1 As New SaveFileDialog()

' if I clicking the ok button, set value true, pdfreport will be created


How do you create the PDF report?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #5
Hi,

I have referenced a PdfCreatorLibrary (PdfCreatorLib.dll - Version
1.0.1284.20348 - Copyright(c) Serdar Dirican) and this creates the report

Joerg

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb im Newsbeitrag
news:bp*************@ID-208219.news.uni-berlin.de...
* "Joerg Trumpfheller" <ex***********************@volkswagen.de> scripsit:
Don't know how to get info about the second dialog which appears after
clicking a button of the first dialog.

following situation:

Dim saveMode As Boolean
Dim saveFileDialog1 As New SaveFileDialog()

' if I clicking the ok button, set value true, pdfreport will be created


How do you create the PDF report?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>

Nov 20 '05 #6
I think I will do it that way:

Before opening the saveasdialog I ask
if System.IO.File.Exists(file to create).
If is so system.io.file.delete(..)
This works, but not the normal way I think.

Joerg
Nov 20 '05 #7
* "Joerg Trumpfheller" <ex***********************@volkswagen.de> scripsit:
I have referenced a PdfCreatorLibrary (PdfCreatorLib.dll - Version
1.0.1284.20348 - Copyright(c) Serdar Dirican) and this creates the report


Maybe the messagebox is shown by this library?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #8
Cor
Hi Joerg,
When you know what file to delete, you also know what file to write, than
you don't need the filesave dialog at all I think, something strange..

Cor
Before opening the saveasdialog I ask
if System.IO.File.Exists(file to create).
If is so system.io.file.delete(..)
This works, but not the normal way I think.

Nov 20 '05 #9
hi cor,

customers sometimes have to decide, if they use subfolders for save.
Therefore the savefiledialog.

Joerg
"Cor" <no*@non.com> schrieb im Newsbeitrag
news:uq***************@TK2MSFTNGP10.phx.gbl...
Hi Joerg,
When you know what file to delete, you also know what file to write, than
you don't need the filesave dialog at all I think, something strange..

Nov 20 '05 #10
Cor
Hi Joerg,

Customers are always king, but when you first delete the file and then give
them the change to save another one.

Or did I misunderstood you?

Cor
Nov 20 '05 #11
Hy Cor,

anyway I don't know how to manage my first described problem. I think it
also wil happen to a standard savefiledialog, if the file you want to save
already exists. In excel this is an error with a errornumber and I can react
for this. With this example I don't know what to do. Some more ideas?

Joerg

"Cor" <no*@non.com> schrieb im Newsbeitrag
news:e2**************@TK2MSFTNGP11.phx.gbl...
Hi Joerg,

Customers are always king, but when you first delete the file and then give them the change to save another one.

Or did I misunderstood you?

Cor

Nov 20 '05 #12
"Joerg Trumpfheller" <jr************@compuserve.de> wrote...
anyway I don't know how to manage my first described problem.


I think something else is up... the dialog code you posted works fine. Did
you happen to trace the code, the results of the test work as far as I can
see.

Tom
Nov 20 '05 #13
Cor
Hi Joerg,

Did you check what Herfried was writting, I found it a good idea.

Cor
Nov 20 '05 #14
Hey helpers,

I think I have found the problem. The problem is called Microsoft. :-)
Read here and you know why
http://support.microsoft.com/default...b;en-us;327213

Thanks for help

--
Best wishes
Joerg
... any % of U is as good as the whole pie ...
__________________________________________________ ________
E-Mail: ma**@jtrumpfheller.com; jr************@compuserve.de (Home)
Homepage: http://www.jtrumpfheller.com; http://jtrumpfheller.com
__________________________________________________ ________
Nov 20 '05 #15
Cor
Thanks Joerg,

Till now I did never use a module, but I am glad you did show it to us.
(A reason more to avoid it)

Thanks,

Cor
Nov 20 '05 #16
Hy people,

I was looking for some more msgs describing the same problem. It is
described in detail under the subject savefiledialog. In the MSDN -
Konowledge base is an article under
http://support.microsoft.com/default...b;en-us;327213
So all answers I get did ot solve the problem. Clicking Ok and the file
exists returns a dialogresult.cancel no matter if you they yes or no for
overwrite.

Thanks for help

--
Best wishes
Joerg

"Joerg Trumpfheller" <ex***********************@volkswagen.de> schrieb im
Newsbeitrag news:bp*********@doiweb4.volkswagen.de...
Hi folks,

Don't know how to get info about the second dialog which appears after
clicking a button of the first dialog.

following situation:

Dim saveMode As Boolean
Dim saveFileDialog1 As New SaveFileDialog()

' if I clicking the ok button, set value true, pdfreport will be created

If (saveFileDialog1.ShowDialog() = DialogResult.OK) Then
saveMode = True
Else
saveMode = False
End If

for the first time running this it works fine. The next time I start and
click the ok button a new dialog appears with a message "File already
exists, Override Yes/No". After clicking yes the programm runs on at the
else mode, so the saveMode var is set to false.

How can I ask for return values of the second dialog? Any idea?

Joerg
--
Email: Jo****************@IndustrieHansa.de
ex***********************@volkswagen.de


Nov 20 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Richard L Rosenheim | last post by:
I would like to detect when a form is invoked as the result of a ShowDialog call. Anyone have any ideas or suggestions on how to do that? TIA, Richard Rosenheim
3
by: carmen | last post by:
I need to pass a parameter to a class while calling Showdialog method, is this possible? Thanks, Carmen
2
by: dbuchanan | last post by:
Hello, My application has a series of forms that open using ShowDialog() on top of their parent as the user drills down to enter increasingly more detail regarding data. I want to hide the...
2
by: **Developer** | last post by:
I have a little more info about this problem I can't seem to solve! I know it'll take a minute to study the lising but if you like to sove puzzles there is one there. I have a Form (FV&C)...
11
by: osmarjunior | last post by:
I have a sequence of commands like this: Form1 frm = new Form1(); frm.LoadData(); Boolean confirm = (frm.ShowDialog() == DialogResult.OK); The LoadData method loads information from...
2
by: NickP | last post by:
Hi there, I was wondering if there was any way to stop the hiding of a dialog from returning from the ShowDialog function? i.e. If you create your own dialog and put some code in that hides it...
2
by: Freddy Coal | last post by:
Hi, I make a a program with two Form, I call Form2 as showdialog() I Would like receive data when Form2 is closed, how make that?. How return data when the form is closing or closed?. Thanks...
14
by: shark | last post by:
Hi, Does Form.ShowDialog() start new thread ? If yes how is solved cross-thread operations? Thx
8
by: Joe Duchtel | last post by:
Hello - I have the following code to detemine a file name when my application is saving a file. The problem is that if the file already exists and I select the Yes button in the "Do you want to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.