Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Handle for a child window?

Handle for a child window?

Scheduled Pinned Locked Moved C#
csharpquestionhelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lxhan
    wrote on last edited by
    #1

    How do I get the handle for a child window from a MDI in C#.Net? Getting the handle to the Mainframe window is quite easy, but I'm having some problems retrieving the handle from one of many child windows? So, if I have several child windows open in a parent window, how do I get the handle of only one child window? Any help will be appreciated. Thanks!

    S L 2 Replies Last reply
    0
    • L lxhan

      How do I get the handle for a child window from a MDI in C#.Net? Getting the handle to the Mainframe window is quite easy, but I'm having some problems retrieving the handle from one of many child windows? So, if I have several child windows open in a parent window, how do I get the handle of only one child window? Any help will be appreciated. Thanks!

      S Offline
      S Offline
      Stephane Rodriguez
      wrote on last edited by
      #2

      the Controls collection brings access to children. Controls.item[i].Handle is the window handle of the ith children.

      1 Reply Last reply
      0
      • L lxhan

        How do I get the handle for a child window from a MDI in C#.Net? Getting the handle to the Mainframe window is quite easy, but I'm having some problems retrieving the handle from one of many child windows? So, if I have several child windows open in a parent window, how do I get the handle of only one child window? Any help will be appreciated. Thanks!

        L Offline
        L Offline
        LongRange Shooter
        wrote on last edited by
        #3

        I had code where I needed to iterate through my children looking for replicated data being displayed between the child displays.

        	public void mdiParent\_childLoadComplete(object sender, LoadCompleteEventArgs senderArgs)
        	{
        		System.Windows.Forms.Form\[\] formArray = this.MdiChildren;
        		int color = formArray.Length - 1;
        		if (color < 1)
        			return;
        		editView newForm = new editView();
        
        		// first : locate the form just built
        		foreach (editView children in formArray)
        		{
        			if (children.Text == senderArgs.delegateIdentifier)
        			{
        				newForm = children;
        				break;
        			}
        		}
        

        _____________________________________________ The world is a dangerous place.
        Not because of those that do evil,
            but because of those who look on and do nothing.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups