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

C#

 
AnswerRe: Overriding custom contol OnPaint Pin
Lutosław5-Jul-08 10:14
Lutosław5-Jul-08 10:14 
QuestionMDI Parent and Child Pin
benjamin yap5-Jul-08 5:27
benjamin yap5-Jul-08 5:27 
AnswerRe: MDI Parent and Child Pin
hpjchobbes5-Jul-08 8:04
hpjchobbes5-Jul-08 8:04 
GeneralRe: MDI Parent and Child [modified] Pin
benjamin yap6-Jul-08 0:08
benjamin yap6-Jul-08 0:08 
GeneralRe: MDI Parent and Child Pin
DaveyM696-Jul-08 1:33
professionalDaveyM696-Jul-08 1:33 
GeneralRe: MDI Parent and Child [modified] Pin
benjamin yap6-Jul-08 1:38
benjamin yap6-Jul-08 1:38 
GeneralRe: MDI Parent and Child Pin
DaveyM696-Jul-08 1:59
professionalDaveyM696-Jul-08 1:59 
GeneralRe: MDI Parent and Child Pin
benjamin yap6-Jul-08 2:07
benjamin yap6-Jul-08 2:07 
why does it look so complicated. LOL.. okay i show u more of my code probably u got a simpler way.

FrmMain
namespace EBMS
{
    public partial class FrmMain : Form
    {
        public Hashtable staffTable;

        public FrmMain()
        {
            InitializeComponent();
            staffTable = new Hashtable();
        }
        private void FrmMain_Load(object sender, EventArgs e)
        {
            
            this.toolStripStaff.Visible = false;
            this.toolStripCatalogue.Visible = false;
            this.toolStripOrder.Visible = false;
            this.toolStripInventory.Visible = false;
            this.toolStrip.Enabled = false; 
            FrmLogin childLogin = new FrmLogin();
            childLogin.ShowDialog(this);
            if (childLogin.DialogResult == DialogResult.OK)
            {
                this.toolStripStaff.Visible = true;
                this.toolStripCatalogue.Visible = true;
                this.toolStripOrder.Visible = true;
                this.toolStripInventory.Visible = true;
                this.toolStripLogin.Visible = false;
                this.toolStrip.Enabled = true; 
                stripLblLoginAs.Text = "Login As : " + childLogin.Username;
            }
            
        }


as u can see inside the constructor of FrmMain(), i have created an instance of the hashtable called 'staffTable'


FrmLogin
namespace EBMS
{
    public partial class FrmLogin : Form
    {
        public FrmMain ParentForm;
        private Staff staff;

        public FrmLogin()
        {
            InitializeComponent();
            staff = new Staff("Admin", "S123456I", "pass123", "13 April 1988", "address", 12345678, 12346567, true, true, false, true);
            ((FrmMain)ParentForm).staffTable.Add("S123456I", staff);
        }



as u can see my FrmLogin last line of code, it will call the instance (staffTable) that is created in FrmMain when it loaded


Staff.cs
using System;
using System.Collections.Generic;
using System.Text;

namespace EBMS
{
    public class Staff
    {
        private string name;
        private string nric;
        private string password;
        private string dob;
        private string address;
        private uint mobile;
        private uint home;
        private bool catManager;
        private bool inventManager;
        private bool orderManager;
        private bool administrator;

        public Staff(string name, string nric, string password, string dob,
                    string address, uint mobile, uint home, bool catManager, bool inventManager,
                    bool orderManager, bool administrator)
        {
            this.name = name;
            this.nric = nric;
            this.password = password;
            this.dob = dob;
            this.address = address;
            this.mobile = mobile;
            this.home = home;
            this.catManager = catManager;
            this.inventManager = inventManager;
            this.orderManager = orderManager;
            this.administrator = administrator;
        }

        public string Name
        {
            get { return name; }
        }
        public string NRIC
        {
            get { return nric; }
        }
        public string Password
        {
            get { return password; }
        }
        public string DOB
        {
            get { return dob; }
        }

        public string Address
        {
            get { return address; }
        }
        public uint Mobile
        {
            get { return mobile; }
        }
        public uint Home
        {
            get { return home; }
        }
        public bool CatManager
        {
            get { return catManager; }
        }
        public bool InventManager
        {
            get { return inventManager; }
        }
        public bool OrderManager
        {
            get { return orderManager; }
        }
        public bool Administrator
        {
            get { return administrator; }
        }
    }
}

GeneralRe: MDI Parent and Child Pin
DaveyM696-Jul-08 2:18
professionalDaveyM696-Jul-08 2:18 
GeneralRe: MDI Parent and Child [modified] Pin
DaveyM696-Jul-08 4:16
professionalDaveyM696-Jul-08 4:16 
GeneralRe: MDI Parent and Child [modified] Pin
benjamin yap6-Jul-08 4:48
benjamin yap6-Jul-08 4:48 
GeneralRe: MDI Parent and Child Pin
DaveyM696-Jul-08 5:45
professionalDaveyM696-Jul-08 5:45 
GeneralRe: MDI Parent and Child [modified] Pin
benjamin yap6-Jul-08 6:00
benjamin yap6-Jul-08 6:00 
GeneralRe: MDI Parent and Child Pin
DaveyM696-Jul-08 8:12
professionalDaveyM696-Jul-08 8:12 
GeneralRe: MDI Parent and Child Pin
DaveyM696-Jul-08 9:22
professionalDaveyM696-Jul-08 9:22 
GeneralRe: MDI Parent and Child Pin
benjamin yap6-Jul-08 15:30
benjamin yap6-Jul-08 15:30 
GeneralRe: MDI Parent and Child Pin
DaveyM697-Jul-08 11:29
professionalDaveyM697-Jul-08 11:29 
GeneralRe: MDI Parent and Child Pin
benjamin yap7-Jul-08 22:35
benjamin yap7-Jul-08 22:35 
QuestionBound combobox problem Pin
Alessandra775-Jul-08 4:38
Alessandra775-Jul-08 4:38 
QuestionHow to get a RGB values from an image buffer? Pin
CopperCircle5-Jul-08 2:58
CopperCircle5-Jul-08 2:58 
AnswerRe: How to get a RGB values from an image buffer? Pin
User 66585-Jul-08 3:07
User 66585-Jul-08 3:07 
AnswerRe: How to get a RGB values from an image buffer? Pin
Guffa5-Jul-08 5:47
Guffa5-Jul-08 5:47 
QuestionCreating DataView filter ... Pin
Jammer5-Jul-08 2:52
Jammer5-Jul-08 2:52 
Questionsetup problem for windows application Pin
K V Sekhar5-Jul-08 1:51
K V Sekhar5-Jul-08 1:51 
AnswerRe: setup problem for windows application Pin
Christian Graus5-Jul-08 2:04
protectorChristian Graus5-Jul-08 2:04 

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.