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 08-04-2011, 22:40
Adrian_Juman
Guest
 
Posts: n/a
Default Window Less UserForm

Is it possible to create Userforms without the caption and close buttons?

Last edited by Adrian_Juman; 08-04-2011 at 22:48.
Reply With Quote
  #2  
Old 09-04-2011, 08:37
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 810
Default

Hi.
Only with Api calls.
Place the code in a form. Make sure to change form name in code if needed. Also don't forget to put a close form command button or you can't close it.

Code:
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GWL_STYLE As Long = (-16)           'The offset of a window's style
Private Const WS_CAPTION As Long = &HC00000       'Style to add a titlebar
Private Declare Function DrawMenuBar Lib "user32" ( _
ByVal hwnd As Long) As Long


Private Sub UserForm_Initialize()
    Dim hwndform&, istyle&, x#
    hwndform = FindWindow("ThunderDframe", UserForm1.Caption)
    istyle = GetWindowLong(hwndform, GWL_STYLE)
    istyle = istyle And Not WS_CAPTION
    x = SetWindowLong(hwndform, GWL_STYLE, istyle)
    DrawMenuBar hwndform
End Sub
-John
Reply With Quote
  #3  
Old 09-04-2011, 10:18
Adrian_Juman
Guest
 
Posts: n/a
Default

Thanks John,

Works perfectly.

I tried one I found on an Excel Forum but it didn't work.
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
Preview window - similary to sync window macro for Dar... gorgo Feature requests/wishlist 4 12-05-2010 09:14
Userform norbert_ds CorelDRAW/Corel DESIGNER VBA 8 14-01-2008 11:39
Automatically Populating a userform norbert_ds CorelDRAW/Corel DESIGNER VBA 11 15-06-2007 17:41
help: VBA minimize userform = frozen appwindow wOxxOm CorelDRAW/Corel DESIGNER VBA 1 30-04-2006 05:13
Possible for this Print Window?? dungbtl CorelDRAW/Corel DESIGNER VBA 2 26-04-2004 15:01


All times are GMT -5. The time now is 17:25.


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