TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sachi vasishta
NA
252
0
form hiding/closing event problem
Aug 3 2009 4:43 AM
Hi
In a form called FileHandling.cs ,which is called from the main() function, I will
call another form called LicenceKey. My questionn is after calling the Licencekey form I want to close/hide the Filehandling.cs . I have written the following code to do that but its not working. plz help
private
void
FileHandling_Load(
object
sender,
EventArgs
e)
{
string
path =
@"c:\licence.txt"
;
if
(
File
.Exists(path))
{
FileHandling
.ActiveForm.Close();
Form1
login =
new
Form1
();
this
.Hide();
}
else
{
FileStream
fs =
File
.Create(path, 1024);
byte
[] info =
new
UTF8Encoding
(
true
).GetBytes(
"hi,written"
);
fs.Write(info, 0, info.Length);
fs.Close();
this
.Hide();
LicenceKey
lkey =
new
LicenceKey
();
lkey.Show();
}
}
Note: FileHandling.cs is the Parent form
Thanks
Sachi
Reply
Answers (
4
)
tree view designing in windows application?
how to write an api and call it to create a folder in program files folder