?
Solved

How to control position of a modal window?

Posted on 2006-11-04
2
Medium Priority
?
352 Views
Last Modified: 2010-04-23

 I am developing a vb.net windows application. While showing a form as a modal dialog,  how I can control the position where the modal window will appear .  It is indeed good, if I can control the left and top of the window . Or the effect  of  "bottom of the parent" will be good enough.

   thanking you,
         Samson  
 
0
Comment
Question by:sgs1970
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 17872971
       Dim form As New Form1
        form.Location = Me.Poi New Point(100, 100)
        form.Width = 200
        form.Height = 200
        form.ShowDialog()

If you want to do this inside of child form itself, do this  in the form Load event handler. To find new form coordinates relatively to parent coordinates, use Control.PointToCScreen Method. For example, this line
form.Location = Me.PointToScreen(New Point(100, 100))
sets child form torm to position (100, 100) relatively to current form.
0
 
LVL 7

Accepted Solution

by:
Mohamed Zedan earned 375 total points
ID: 17876028
but you have to set the form property

Form.StartPosition = FormStartPosition.Manual

for it to display at the position specified..
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question