Hi,
In my application i am restoring my files from the server to my desktop application in the same location(drive) it was before. Like c:\a\b\text.txt.
Now while restoring if text.txt file allready exist I need to show a pop up form with options like..
/ ..................................................................................../
This folder allready contains a file called text.txt
Would u like to replace the existing
text.txt
last modified : 06/06/06
with this one
last modified : 08/08/08
YES YES to All No Cancel
/ ..................................................................................../
I tried making a saparate form....but when i click yes/no/cancel/yes to all/(hiding this form) how the other form will know what the user has clicked so that It can form the specified task...
Please help....
Biswas
Basu BiswasPosted Jan 19, 2007, 7:08 AM
Hi .....i want sum hint and suggesstion if anyone can provide.....
i want to make one custom control which i will be using in different project....let me explain....
I made one dialogue box....now i want to make it a custom control...say i will b makin a .dll file of it which i will include in my project and use that dialogue box as another control..
How can i do that....
let me make u clear....i know nothing about making such controls....
if anyone suggesst me sumthing ....i'll be greatful to u...
.............................
Hope sumday i will b helpin others here....lol
Basu BiswasPosted Jan 19, 2007, 6:57 AM
Basu BiswasPosted Jan 19, 2007, 6:51 AM
MartinPosted Jan 19, 2007, 4:20 AM
enum BoxResults { YES, YESTOALL, NO, CANCEL }
Then you make a private variable in your form like this:
private BoxResults buttonClicked = BoxResults.CANCEL; // setting to cancel, if user clicks the red cross
And then depending on which button he clicks, before closing, you'll do something like: buttonClicked = BoxResults.Yes;
Then finally you make a property to retrive the result, as such:
public BoxResults ButtonClicked
{
get { return buttonClicked; }
}
And in the form that calls the box/needs the result, use the code like this (we assume the above form/box is called ConfirmBox)
ConfirmBox box = new ConfirmBox();
box.ShowDialog();
ConfirmBox.BoxResults result = box.ButtonClicked;
switch(result)
{
case ConfirmBox.BoxResults.YES:
// Do stuff
break;
case ConfirmBox.BoxResults.No:
// Do something else
break;
}
And so forth.