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
roger 0
NA
3
0
Return a value from a child Form
Aug 6 2004 10:45 AM
Hopefully a simple one, but is perplexing me ... I have a main class that calls a logon form to validate users against a DB backend... The login form works fine but from my main class I want to return a value ( true or false ) from the login form to either allow the main MDI form to run or terminate the application. Not sure if my approach is correct, in fact being new to C# struggling quite alot with scope in general .. but any pointers gratefully received TIA Dave Main Cls frmLogon myfrmLogon =new frmLogon(); bool myretval = myfrmLogon.Show(); //Cannot implicitly convert type 'void' to 'bool' error here Logon Form private bool logon; private void frmLogon_Load(object sender, System.EventArgs e) { logon = false; } ///// Various logon form code removed that sets the logon varivle true or false private bool frmLogon_Closing(object sender,System.ComponentModel.CancelEventArgs e) { return logon; }
Reply
Answers (
2
)
3rd Party Widgets and Oscilloscope
How to detect changes in a DataGrid control