Results 1 to 1 of 1

Thread: position form over another form at precise location

Threaded View

  1. #1

    Thread Starter
    Fanatic Member ZeBula8's Avatar
    Join Date
    Oct 2002
    Posts
    548

    Resolved position form over another form at precise location

    I have 2 forms -

    Form1 calls the second form, Form2
    I'm trying to position the second form at the exact location of the caret. I already have that position using GetCaretPos api. Only problem is that the form does not position itself at the location I have given. Any ideas why?

    partial code below:

    VB Code:
    1. ' here is the caret position retreived
    2.     GetCaretPos pt
    3.     XPos = pt.x
    4.     YPos = pt.y
    5.    
    6.    ' call this first
    7.    SetParent Form2.hwnd, Form1.hwnd
    8.  
    9.    ' tell the form where to move
    10.    Form2.Move XPos, YPos
    11.  
    12.    ' telling form that Main form is the parent
    13.    Form2.Show vbModal, Form1

    FYI -

    It seems if I make a call to SetParent api - it works as expected...
    Last edited by ZeBula8; Dec 3rd, 2005 at 05:01 PM. Reason: came upon a solution

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width