Click here to Skip to main content
15,913,610 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help need regarding SendMessageTimeout for IE window Pin
vishal nerkar26-Feb-12 3:11
vishal nerkar26-Feb-12 3:11 
Questionhelp me: when installing the management software, often times it built the database into it, so how do I do that? thank you! Pin
ajax_vn25-Feb-12 5:56
ajax_vn25-Feb-12 5:56 
AnswerRe: help me: when installing the management software, often times it built the database into it, so how do I do that? thank you! Pin
Dave Kreskowiak25-Feb-12 6:21
mveDave Kreskowiak25-Feb-12 6:21 
AnswerRe: help me: when installing the management software, often times it built the database into it, so how do I do that? thank you! Pin
Abhinav S25-Feb-12 17:16
Abhinav S25-Feb-12 17:16 
QuestionGet Active mdichild form Pin
Mr.Kode25-Feb-12 2:11
Mr.Kode25-Feb-12 2:11 
AnswerRe: Get Active mdichild form Pin
Alisaunder25-Feb-12 2:49
Alisaunder25-Feb-12 2:49 
GeneralRe: Get Active mdichild form Pin
Mr.Kode25-Feb-12 22:36
Mr.Kode25-Feb-12 22:36 
GeneralRe: Get Active mdichild form Pin
Alisaunder26-Feb-12 13:13
Alisaunder26-Feb-12 13:13 
This is how I did it when using MDI.

I used a Tree View control populated with A-Z subnodes would be names organized last to first with a comma and middle initial, and I would store the id of the record containing the information in the tag element of the Tree View like so.

C#
private void updateTreeview()
        {
            //add letters sort nodes
            for (int i = System.Convert.ToInt32('A'); i <= System.Convert.ToInt32('Z'); i++)
            {
                treeView1.Nodes.Add(Convert.ToString((char)(i)), Convert.ToString((char)(i))); //set key and text
            }

            //add customers
            TreeNode childnode = null;
            string sContactsName = null;
            foreach (DataRow rowContacts in dtContacts.Rows)
            {
                sContactsName = string.Concat(rowContacts["LastName"].ToString(), ", ", rowContacts["FirstName"].ToString());

                if (!(System.Convert.IsDBNull(rowContacts["MiddleInitial"].ToString())))
                {
                    sContactsName = string.Concat(sContactsName, " ", rowContacts["MiddleInitial"].ToString(), ".");
                }
                //---------------------Key lines here --------------
                childnode = new TreeNode(sContactsName, 0, 1);
                childnode.Name = sContactsName; //set text as key
                childnode.Tag = rowContacts["ContactID"].ToString();
                //--------------------------------------------------

                string sortnode = sContactsName.Substring(0, 1).ToUpper(); //gets alphabet sort node by first letter
                treeView1.Nodes[sortnode].Nodes.Add(childnode);
            }

            //Update TreeView
            treeView1.Visible = true;
            treeView1.Enabled = true;
            treeView1.ExpandAll();
        }


After the node containing the name was clicked I handled it like this:

C#
private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
{
    string nodeName = e.Node.Name;

    if (nodeName.Length == 1)
    {
        return; //is alphabet sort node, exit
    }

    //see if child form already exists and show it
    foreach (Form f in this.MdiChildren)
    {
        if (f.Name == nodeName)
        {
            f.Activate();
            return;
        }
    }


    string id = e.Node.Tag.ToString();

    displayContact(nodeName, id);
}


This checked the form by id to see if it was already displayed and only created a new form if it was not displayed.
Questionto filter datagridview records having column having null value Pin
polachan24-Feb-12 9:06
polachan24-Feb-12 9:06 
AnswerRe: to filter datagridview records having column having null value Pin
Eddy Vluggen24-Feb-12 9:42
professionalEddy Vluggen24-Feb-12 9:42 
AnswerRe: to filter datagridview records having column having null value Pin
polachan28-Feb-12 23:42
polachan28-Feb-12 23:42 
GeneralRe: to filter datagridview records having column having null value Pin
Eddy Vluggen29-Feb-12 0:26
professionalEddy Vluggen29-Feb-12 0:26 
Questiondata akses to mySql using c# Pin
tian's emo24-Feb-12 2:52
tian's emo24-Feb-12 2:52 
AnswerRe: data akses to mySql using c# Pin
R. Giskard Reventlov24-Feb-12 5:32
R. Giskard Reventlov24-Feb-12 5:32 
GeneralRe: data akses to mySql using c# Pin
tian's emo25-Feb-12 1:28
tian's emo25-Feb-12 1:28 
AnswerRe: data akses to mySql using c# Pin
kid sister24-Feb-12 18:22
kid sister24-Feb-12 18:22 
QuestionCompress with java decompress with c# Pin
Hossein Khalaj24-Feb-12 2:46
Hossein Khalaj24-Feb-12 2:46 
AnswerRe: Compress with java decompress with c# Pin
Eddy Vluggen24-Feb-12 8:42
professionalEddy Vluggen24-Feb-12 8:42 
AnswerRe: Compress with java decompress with c# Pin
Bernhard Hiller26-Feb-12 20:32
Bernhard Hiller26-Feb-12 20:32 
QuestionReading Null values in a byte array Pin
si_6924-Feb-12 1:24
si_6924-Feb-12 1:24 
AnswerRe: Reading Null values in a byte array Pin
Dave Kreskowiak24-Feb-12 4:07
mveDave Kreskowiak24-Feb-12 4:07 
AnswerRe: Reading Null values in a byte array Pin
Matt Meyer24-Feb-12 5:21
Matt Meyer24-Feb-12 5:21 
QuestionHow to filter record when combobox value is null Pin
polachan24-Feb-12 0:56
polachan24-Feb-12 0:56 
AnswerRe: How to filter record when combobox value is null Pin
Bernhard Hiller26-Feb-12 20:39
Bernhard Hiller26-Feb-12 20:39 
Questionaccessing the value of control between seperate Forms Pin
Fred 3424-Feb-12 0:10
Fred 3424-Feb-12 0:10 

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.