Click here to Skip to main content
15,891,253 members
Home / Discussions / C#
   

C#

 
QuestionSharp Develop Regular Expression Pin
xawsccs30-Jul-07 5:38
xawsccs30-Jul-07 5:38 
AnswerRe: Sharp Develop Regular Expression Pin
led mike30-Jul-07 5:49
led mike30-Jul-07 5:49 
AnswerRe: Sharp Develop Regular Expression Pin
Martin#30-Jul-07 6:00
Martin#30-Jul-07 6:00 
GeneralRe: Sharp Develop Regular Expression Pin
xawsccs31-Jul-07 6:25
xawsccs31-Jul-07 6:25 
AnswerRe: Sharp Develop Regular Expression Pin
Paul Conrad30-Jul-07 6:22
professionalPaul Conrad30-Jul-07 6:22 
QuestionAccess to the class variable in the Program.cs Pin
UweOeder30-Jul-07 5:31
professionalUweOeder30-Jul-07 5:31 
AnswerRe: Access to the class variable in the Program.cs Pin
led mike30-Jul-07 5:47
led mike30-Jul-07 5:47 
AnswerRe: Access to the class variable in the Program.cs Pin
PhilDanger30-Jul-07 6:05
PhilDanger30-Jul-07 6:05 
frmChecqueApp has no knowledge of frmTheLogin since they are in separate scopes.

You need to make frmChecqueApp aware of the form (and preferably only the data from the form that you want access to).
My suggestion would be to pass in the username and accessright into frmChecqueApp's constructor as follows:

public frmChequeApp(string userName, Int32 accessRight)
{ 
InitializeComponent();

strUsername = userName;
intAccessRight = accessRight;

}



and then in your Program.cs you would change it to:

namespace ChequeApp
{
static class Program
{
/// 
/// The main entry point for the application.
/// 
[STAThread]
static void Main()
{
frmLogin frmTheLogin;

Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);

frmTheLogin = new frmLogin();

if (frmTheLogin.ShowDialog() == DialogResult.OK)
{
      Application.Run(new frmChequeApp(frmTheLogin.UserName, frmTheLogin.AccessRight)); //this line changed
}

}
}

GeneralRe: Access to the class variable in the Program.cs Pin
UweOeder30-Jul-07 21:00
professionalUweOeder30-Jul-07 21:00 
QuestionDataGridView Max Rows Pin
jasper01830-Jul-07 5:22
jasper01830-Jul-07 5:22 
AnswerRe: DataGridView Max Rows Pin
led mike30-Jul-07 5:26
led mike30-Jul-07 5:26 
QuestionC# Prep Statement doesn't insert string Pin
NRworld30-Jul-07 4:43
NRworld30-Jul-07 4:43 
AnswerRe: C# Prep Statement doesn't insert string Pin
Pete O'Hanlon30-Jul-07 9:49
mvePete O'Hanlon30-Jul-07 9:49 
GeneralRe: C# Prep Statement doesn't insert string Pin
PIEBALDconsult30-Jul-07 11:23
mvePIEBALDconsult30-Jul-07 11:23 
Questioncomand line Pin
ankit_mait30-Jul-07 4:30
ankit_mait30-Jul-07 4:30 
AnswerRe: comand line Pin
CPallini30-Jul-07 4:38
mveCPallini30-Jul-07 4:38 
QuestionIs there a way to disable "Close" button on title bar? Pin
Tesic Goran30-Jul-07 4:21
professionalTesic Goran30-Jul-07 4:21 
AnswerRe: Is there a way to disable "Close" button on title bar? Pin
originSH30-Jul-07 4:52
originSH30-Jul-07 4:52 
GeneralRe: Is there a way to disable "Close" button on title bar? [modified] Pin
Tesic Goran30-Jul-07 5:02
professionalTesic Goran30-Jul-07 5:02 
GeneralRe: Is there a way to disable "Close" button on title bar? Pin
originSH30-Jul-07 5:20
originSH30-Jul-07 5:20 
GeneralRe: Is there a way to disable "Close" button on title bar? Pin
Tesic Goran30-Jul-07 5:47
professionalTesic Goran30-Jul-07 5:47 
GeneralRe: Is there a way to disable "Close" button on title bar? Pin
originSH30-Jul-07 6:08
originSH30-Jul-07 6:08 
GeneralRe: Is there a way to disable "Close" button on title bar? Pin
PIEBALDconsult30-Jul-07 11:25
mvePIEBALDconsult30-Jul-07 11:25 
QuestionAlternative to Pegasus ImagXpress Pin
R.Myers30-Jul-07 3:43
R.Myers30-Jul-07 3:43 
AnswerRe: Alternative to Pegasus ImagXpress Pin
GrinderDev30-Jul-07 4:03
GrinderDev30-Jul-07 4:03 

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.