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. Setting form location

Setting form location

Scheduled Pinned Locked Moved C#
csharphelpquestion
5 Posts 4 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.
  • A Offline
    A Offline
    AnnnS
    wrote on last edited by
    #1

    Hi all i am a fresher in c#... my doubt is that when i open a form from another form i want that form to display on the center of the form from where i call ... i dont want to use mdi forms ... can anybody help me?? Thanks Akhil

    L R 2 Replies Last reply
    0
    • A AnnnS

      Hi all i am a fresher in c#... my doubt is that when i open a form from another form i want that form to display on the center of the form from where i call ... i dont want to use mdi forms ... can anybody help me?? Thanks Akhil

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Form1 form1 = new Form1(); form1.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;

      1 Reply Last reply
      0
      • A AnnnS

        Hi all i am a fresher in c#... my doubt is that when i open a form from another form i want that form to display on the center of the form from where i call ... i dont want to use mdi forms ... can anybody help me?? Thanks Akhil

        R Offline
        R Offline
        Robert Rohde
        wrote on last edited by
        #3

        Hi, Form.StartPosition = FormStartPosition.CenterParent; Robert

        A 1 Reply Last reply
        0
        • R Robert Rohde

          Hi, Form.StartPosition = FormStartPosition.CenterParent; Robert

          A Offline
          A Offline
          AnnnS
          wrote on last edited by
          #4

          Wooowwww.... Thanx soo much in the same way how will i do with messageBox ??? is there any way ??? thanx Akhil

          J 1 Reply Last reply
          0
          • A AnnnS

            Wooowwww.... Thanx soo much in the same way how will i do with messageBox ??? is there any way ??? thanx Akhil

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

            The first parameter of one of the Show method overloads on MessageBox is the owner window (IWin32Window to be exact - so control or form). The messageBox shows up centered over its parent, if passed.

            --- How to get answers to your questions[^]

            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