Click here to Skip to main content
15,914,111 members
Home / Discussions / C#
   

C#

 
Question[Message Deleted] Pin
girishsatya21-Apr-09 22:47
girishsatya21-Apr-09 22:47 
AnswerRe: DLL creating Pin
Rob Philpott21-Apr-09 22:49
Rob Philpott21-Apr-09 22:49 
GeneralRe: DLL creating Pin
yesu prakash21-Apr-09 23:04
yesu prakash21-Apr-09 23:04 
AnswerRe: DLL creating Pin
DaveyM6921-Apr-09 23:01
professionalDaveyM6921-Apr-09 23:01 
GeneralRe: DLL creating Pin
Mycroft Holmes22-Apr-09 1:08
professionalMycroft Holmes22-Apr-09 1:08 
GeneralRe: DLL creating Pin
DaveyM6922-Apr-09 1:29
professionalDaveyM6922-Apr-09 1:29 
QuestionEnable menu strip from another form Pin
misCafe21-Apr-09 22:35
misCafe21-Apr-09 22:35 
AnswerRe: Enable menu strip from another form Pin
DaveyM6921-Apr-09 22:46
professionalDaveyM6921-Apr-09 22:46 
Raise an event in your LogIn form that the MDI form subscribes to.
//FormLogIn.cs
using System;
using System.Windows.Forms;
public partial class FormLogIn : Form
{
    public event EventHandler LogInVerified;
    public FormLogIn()
    {
        InitializeComponent();
        btnOK.Click += new EventHandler(btnOK_Click);
    }

    void btnOK_Click(object sender, EventArgs e)
    {
        // Validate first
        OnLogInOK(EventArgs.Empty);
        Close();
    }
    protected virtual void OnLogInOK(EventArgs e)
    {
        EventHandler eh = LogInVerified;
        if (eh != null)
            eh(this, e);
    }
}
// FormMDI.cs
using System;
using System.Windows.Forms;
public partial class FormMDI : Form
{
    public FormMDI()
    {
        InitializeComponent();
        mnuLogIn.Click += new EventHandler(mnuLogIn_Click);
    }
    private void mnuLogIn_Click(object sender, EventArgs e)
    {
        FormLogIn formLogIn = new FormLogIn();
        formLogIn.LogInVerified += new EventHandler(formLogIn_LogInVerified);
        formLogIn.ShowDialog();
        formLogIn.LogInVerified -= formLogIn_LogInVerified;
        formLogIn.Dispose();
    }
    void formLogIn_LogInVerified(object sender, EventArgs e)
    {
        // Enable menus etc here
    }
}


Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
Why are you using VB6? Do you hate yourself? (Christian Graus)

AnswerRe: Enable menu strip from another form Pin
Rob Philpott21-Apr-09 22:46
Rob Philpott21-Apr-09 22:46 
QuestionTramsfer file accross a network Pin
yesu prakash21-Apr-09 21:50
yesu prakash21-Apr-09 21:50 
AnswerRe: Tramsfer file accross a network Pin
Mbah Dhaim21-Apr-09 22:04
Mbah Dhaim21-Apr-09 22:04 
Questionnew in this industry Pin
benson.misi21-Apr-09 21:42
benson.misi21-Apr-09 21:42 
AnswerRe: new in this industry Pin
Mbah Dhaim21-Apr-09 21:58
Mbah Dhaim21-Apr-09 21:58 
QuestionHow to capture the Windows XP backgournd to gray? (.NET Framework 3.0) Pin
CooperWu21-Apr-09 21:16
CooperWu21-Apr-09 21:16 
QuestionHow i can istall my first project... Pin
VisualLive21-Apr-09 21:13
VisualLive21-Apr-09 21:13 
AnswerRe: How i can istall my first project... Pin
SeMartens21-Apr-09 21:27
SeMartens21-Apr-09 21:27 
GeneralRe: How i can istall my first project... Pin
VisualLive21-Apr-09 21:55
VisualLive21-Apr-09 21:55 
GeneralRe: How i can istall my first project... Pin
SeMartens21-Apr-09 23:41
SeMartens21-Apr-09 23:41 
GeneralRe: How i can istall my first project... Pin
VisualLive22-Apr-09 6:00
VisualLive22-Apr-09 6:00 
GeneralRe: How i can istall my first project... Pin
VisualLive6-May-09 15:43
VisualLive6-May-09 15:43 
QuestionClickable Link Pin
satsumatable21-Apr-09 20:31
satsumatable21-Apr-09 20:31 
AnswerRe: Clickable Link Pin
zk11322991721-Apr-09 20:37
zk11322991721-Apr-09 20:37 
Questionhttp://www.codeproject.com/KB/list/treelistview.aspx Pin
hirenkshah21-Apr-09 19:36
hirenkshah21-Apr-09 19:36 
QuestionExcel: change cell color of unprotect sheet using macro. Pin
hirenkshah21-Apr-09 19:15
hirenkshah21-Apr-09 19:15 
QuestionView PDF file in winform Pin
aldo hexosa21-Apr-09 18:54
professionalaldo hexosa21-Apr-09 18:54 

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.