OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-12-2010, 05:02
0meg@ 0meg@ is offline
Member
 
Join Date: Nov 2010
Posts: 37
Default User form Freeze

Need to show one form by clicking the button and hide parent form. Also i didn't find how to make form not moveable by user.
Reply With Quote
  #2  
Old 10-12-2010, 12:36
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,769
Blog Entries: 9
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Hide Form

You just need to hide the current form and show your second form like this:
Code:
Me.Hide
UserForm2.Show
If you want to make the form unmovable you can use a few API calls to make this work. Something like this:
Code:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Declare Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  
Private Const MF_BYPOSITION As Long = &H400

Private Sub UserForm_Initialize()
    Dim lFrmHdl As Long, iCount As Integer
    
    lFrmHdl = FindWindowA(vbNullString, Me.Caption)

    If lFrmHdl <> 0 Then
        For iCount = 0 To 2
            RemoveMenu GetSystemMenu(lFrmHdl, False), 0, MF_BYPOSITION
        Next iCount
    End If
End Sub
Hope that gets you started,

-Shelby
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add a hyperlink in a User form PAnderson CorelDRAW/Corel DESIGNER VBA 4 15-08-2010 20:54
calling another form with a button in a form gorgo CorelDRAW/Corel DESIGNER VBA 1 27-05-2010 09:23
Creating a shape on a user form? Gadget CorelDRAW/Corel DESIGNER VBA 2 16-01-2008 04:18
[Newbie] User Form Revisited Booker CorelDRAW/Corel DESIGNER VBA 1 16-12-2005 21:08
CD11: Adding input from user form to document ddonnahoe Code Critique 2 09-04-2004 13:43


All times are GMT -5. The time now is 04:19.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com