Click here to Skip to main content
15,888,322 members
Home / Discussions / C#
   

C#

 
Generaluser-defined controls Pin
simwiz5-May-03 22:36
simwiz5-May-03 22:36 
QuestionHow to creat a free IHTMLDocument interface? Pin
benzite5-May-03 21:32
benzite5-May-03 21:32 
AnswerRe: How to creat a free IHTMLDocument interface? Pin
Stephane Rodriguez.5-May-03 22:47
Stephane Rodriguez.5-May-03 22:47 
GeneralRe: How to creat a free IHTMLDocument interface? Pin
benzite6-May-03 0:45
benzite6-May-03 0:45 
GeneralRe: How to creat a free IHTMLDocument interface? Pin
benzite6-May-03 18:03
benzite6-May-03 18:03 
GeneralRe: How to creat a free IHTMLDocument interface? Pin
Stephane Rodriguez.7-May-03 4:39
Stephane Rodriguez.7-May-03 4:39 
GeneralAccess components on modal form from mainform Pin
flyingv5-May-03 19:24
flyingv5-May-03 19:24 
GeneralRe: Access components on modal form from mainform Pin
apferreira5-May-03 22:40
apferreira5-May-03 22:40 
The best thing to do is to implement your dialog results through properties of the frmLogon, i.e.

In your frmLogon, you begin by declaring some private fields

private string userName;<br />
private string password;<br />
private string databaseName;


Then, you create the properties (also in fmrLogon)

public string UserName<br />
{<br />
   get<br />
     {<br />
        return userName;<br />
     }<br />
   set<br />
     {<br />
        userName=value<br />
     }<br />
}<br />
<br />
public string Password<br />
{<br />
   get<br />
     {<br />
        return password;<br />
     }<br />
   set<br />
     {<br />
        password=value<br />
     }<br />
}<br />
<br />
public string DatabaseName<br />
{<br />
   get<br />
     {<br />
        return databaseName;<br />
     }<br />
   set<br />
     {<br />
        databaseName=value<br />
     }<br />
}


After this, don't forget to update your variables when the user presses the OK button. Something like

private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
   this.UserName=textBox1.Text;<br />
   this.Password=textBox2.Text;<br />
   this.DatabaseName=textBox3.Text;<br />
}


Having done this, you are now able to access your dialog results in the main form through the properties. For example...

frmLogon Logon=new frmLogon;<br />
<br />
if(Logon.ShowDialog()==DialogResult.Ok)<br />
{<br />
<br />
//Displays the results of the dialog in a textbox in the main form<br />
this.myTextBox=Logon.UserName +Logon.Password +Logon.DataBaseName<br />
}


Smile | :)
GeneralImages in MainMenu or Popup menu Pin
flyingv5-May-03 18:56
flyingv5-May-03 18:56 
GeneralRe: Images in MainMenu or Popup menu Pin
Kant6-May-03 16:41
Kant6-May-03 16:41 
QuestionHow to get Calling exe resources in a DLL Pin
Ranjan Banerji5-May-03 11:27
Ranjan Banerji5-May-03 11:27 
AnswerRe: How to get Calling exe resources in a DLL Pin
Ranjan Banerji5-May-03 13:53
Ranjan Banerji5-May-03 13:53 
GeneralClearing checked items in a CheckedListBox Pin
Mark Kimball5-May-03 10:59
Mark Kimball5-May-03 10:59 
GeneralRe: Clearing checked items in a CheckedListBox Pin
Kant6-May-03 8:54
Kant6-May-03 8:54 
GeneralRe: Clearing checked items in a CheckedListBox Pin
Mark Kimball6-May-03 9:36
Mark Kimball6-May-03 9:36 
GeneralCollection Sort Performance Pin
Mark Sanders5-May-03 9:30
Mark Sanders5-May-03 9:30 
GeneralRe: Collection Sort Performance Pin
Daniel Turini5-May-03 9:37
Daniel Turini5-May-03 9:37 
GeneralRe: Collection Sort Performance Pin
Mark Sanders5-May-03 9:40
Mark Sanders5-May-03 9:40 
GeneralRe: Collection Sort Performance Pin
James T. Johnson5-May-03 9:43
James T. Johnson5-May-03 9:43 
GeneralRe: Collection Sort Performance Pin
leppie5-May-03 15:13
leppie5-May-03 15:13 
GeneralRe: Collection Sort Performance Pin
Daniel Turini6-May-03 0:38
Daniel Turini6-May-03 0:38 
Generalcontrolling datagrid rows addition Pin
shoe-seal5-May-03 7:47
shoe-seal5-May-03 7:47 
Generalaspnet_wp.exe hangs Pin
Manish K. Agarwal5-May-03 4:30
Manish K. Agarwal5-May-03 4:30 
GeneralRe: aspnet_wp.exe hangs Pin
Paresh Gheewala5-May-03 5:56
Paresh Gheewala5-May-03 5:56 
Generalbrowser Pin
toanlb4-May-03 23:41
toanlb4-May-03 23:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.