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. start position of child form

start position of child form

Scheduled Pinned Locked Moved C#
question
6 Posts 2 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.
  • J Offline
    J Offline
    JstDaNuGuy
    wrote on last edited by
    #1

    How do i set the start position of the childform that i open from my main form? I dont' want it to be in the center of the parent form or FormStartPosition.CenterParent. i want it to be set at 218,28 of the parent form :-D :laugh: ;p :^) :sigh:

    C 1 Reply Last reply
    0
    • J JstDaNuGuy

      How do i set the start position of the childform that i open from my main form? I dont' want it to be in the center of the parent form or FormStartPosition.CenterParent. i want it to be set at 218,28 of the parent form :-D :laugh: ;p :^) :sigh:

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      You need to set it manually, which means you need to set it AFTER you show the form. Otherwise, the framework moves it on you. So, you need to get the position of the parent form top and left, and add 218,28 to it Christian Graus - Microsoft MVP - C++

      J 1 Reply Last reply
      0
      • C Christian Graus

        You need to set it manually, which means you need to set it AFTER you show the form. Otherwise, the framework moves it on you. So, you need to get the position of the parent form top and left, and add 218,28 to it Christian Graus - Microsoft MVP - C++

        J Offline
        J Offline
        JstDaNuGuy
        wrote on last edited by
        #3

        Right,got that, but how do i refrence that to the parent form? would it help if i better explain? i've got my parent form set to load at the same point based on where you closed it. the problem i'm having is trying to refrence the location of 218,28 of the parent form, since the form isn't allways going to be located at 0,0, it maybe located on screen two or three of a multi-screen system, and the user has to move across to system.drawing.point(218,28) just to reach the new form... not sure, maybe i'm just missing your point...no punn intended pretty much i've tried everthing i can think of(yes, very limited) and the most i've found to even come close was this.PointToClient. this was nice, it moved the new form in relation to the parent form, but the problem is it often disappears based on the parent form...basically it didn't work correctly ever. :-D :laugh: ;p :^) :sigh:

        C 1 Reply Last reply
        0
        • J JstDaNuGuy

          Right,got that, but how do i refrence that to the parent form? would it help if i better explain? i've got my parent form set to load at the same point based on where you closed it. the problem i'm having is trying to refrence the location of 218,28 of the parent form, since the form isn't allways going to be located at 0,0, it maybe located on screen two or three of a multi-screen system, and the user has to move across to system.drawing.point(218,28) just to reach the new form... not sure, maybe i'm just missing your point...no punn intended pretty much i've tried everthing i can think of(yes, very limited) and the most i've found to even come close was this.PointToClient. this was nice, it moved the new form in relation to the parent form, but the problem is it often disappears based on the parent form...basically it didn't work correctly ever. :-D :laugh: ;p :^) :sigh:

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          The parent form has a Left property and a Top property. At least, I think it does :-) I'd take those, and add the values to that. And, if you set the owner of the child form to be the parent, the code can go in the child form, it can move itself when it is first shown, and check it's owners position as a starting point. Christian Graus - Microsoft MVP - C++

          J 1 Reply Last reply
          0
          • C Christian Graus

            The parent form has a Left property and a Top property. At least, I think it does :-) I'd take those, and add the values to that. And, if you set the owner of the child form to be the parent, the code can go in the child form, it can move itself when it is first shown, and check it's owners position as a starting point. Christian Graus - Microsoft MVP - C++

            J Offline
            J Offline
            JstDaNuGuy
            wrote on last edited by
            #5

            Actually, that was one of the things that i didn't think of at the time of writing that last post, i actually had just testing that before you replied... having some difficulty as i having to make sure everything is in its proper place...oh syntax..... i'll post my results in a few...hopefully! :-D :laugh: ;p :^) :sigh:

            J 1 Reply Last reply
            0
            • J JstDaNuGuy

              Actually, that was one of the things that i didn't think of at the time of writing that last post, i actually had just testing that before you replied... having some difficulty as i having to make sure everything is in its proper place...oh syntax..... i'll post my results in a few...hopefully! :-D :laugh: ;p :^) :sigh:

              J Offline
              J Offline
              JstDaNuGuy
              wrote on last edited by
              #6

              hey, yah, as simple as it was, that was the solution.... why is it easier to think of the hard(or complicated) solutions before thinking of the simple ones? must just be me.... :confused: :-D :laugh: ;p :^) :sigh:

              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