Results 1 to 7 of 7

Thread: Form in ActiveX Control

  1. #1

    Thread Starter
    Hyperactive Member Janaka's Avatar
    Join Date
    Nov 2001
    Posts
    277

    Smile Form in ActiveX Control

    I designed an ActiveX control and include a form in it
    For a particular event in the ActiveX control I should show the form

    This is the method I use to display

    VB Code:
    1. If Not frmClassOCXLoader.Visible Then
    2.             frmClassOCXLoader.Show
    3.             frmClassOCXLoader.SetFocus
    4. End If
    But the problem is this form is shown underneath the from, that contains the ActiveX control.

    What I want to show is the form in the ActiveX Control above the form that contains the ActiveX control.
    Last edited by Janaka; Jun 19th, 2002 at 10:59 PM.

  2. #2

    Thread Starter
    Hyperactive Member Janaka's Avatar
    Join Date
    Nov 2001
    Posts
    277
    *bump*

  3. #3
    Addicted Member
    Join Date
    May 2002
    Location
    FlyingOffice
    Posts
    178
    Try using the SetWindowPosition for the form, to put it on top of all others

  4. #4

    Thread Starter
    Hyperactive Member Janaka's Avatar
    Join Date
    Nov 2001
    Posts
    277
    is this a api function ??

  5. #5
    Hyperactive Member ashay's Avatar
    Join Date
    Feb 2002
    Location
    Mumbai,India
    Posts
    278
    hi,

    u need to use WinAPi for that......

    use
    Public Declare Function SetFocus Lib "user32" (ByVal hwnd As Long) As Long


    u need to pass the handle of the form as the parameter to the Setfocus function....

    hope this helps.....

    regds,
    ashay

  6. #6
    Addicted Member
    Join Date
    May 2002
    Location
    FlyingOffice
    Posts
    178

  7. #7
    Addicted Member chander's Avatar
    Join Date
    Nov 2000
    Location
    New Delhi , India
    Posts
    225
    show form as vbmodal ...

    form1.show vbmodal

    or use ShowWindow API ..
    Chander
    Email:[email protected]

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