OberonPlace.com Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #21  
Old 19-03-2006, 12:22
Booker
Guest
 
Posts: n/a
Default

Hey this all neat to learn but abit complex for chaps like myself...

I counldn't get it to work.

Is it possible to whip up a small form as a template so us newbies
can get ourselves into deeper trouble trying to figure this stuff out?

Maybe a small form where we can place some tools etc.

Also, a while back ago I seen a dial 'Knob' that this one person had in CD,
he wasnt too friendly so I didnt bother to ask.

B ker
Reply With Quote
  #22  
Old 19-03-2006, 19:08
akayani
Guest
 
Posts: n/a
Default

I just looks complex...

All you have to do is put your forms caption where the commented section is in the macro.

Then call the macro via sub...

Private Sub UserForm_Click()
Call WinCall.ChangeBorderStyle
End Sub

The above is when the macro is in a module called WinCall.

I will do something up for you in a day or so if no one else has.

Yani
Reply With Quote
  #23  
Old 20-03-2006, 10:34
akayani
Guest
 
Posts: n/a
Default

Code:
Public Sub ChangeBorderStyle(MyState As Boolean, MyFormName As String)

    Dim WindowHandle As Long
    Dim R As RECT
    Const BLess14 = WS_CAPTION
    Const BLess3 = &HC80080
    Const BLess3_EX = &H101
    Const BLessE = WS_THICKFRAME Or WS_CAPTION

'Replace My Form Caption with Your Forms Caption
'Changed from a specific form to a var which is passed with the function
    
    WindowHandle = FindWindow(vbNullString, MyFormName)

    If WindowHandle > 0 Then

        SetWindowLong WindowHandle, GWL_STYLE, GetWindowLong(WindowHandle, GWL_STYLE) Xor BLess14
        GetWindowRect WindowHandle, R
        If MyState = False Then
        SetWindowPos WindowHandle, 0, R.left, R.Top, R.right - R.left + 1, R.bottom - R.Top - 24, SWP_NOMOVE
        Else
        SetWindowPos WindowHandle, 0, R.left, R.Top, R.right - R.left, R.bottom - R.Top + 24, SWP_NOMOVE
        End If

    End If

End Sub


AND THAT GOES WITH THIS ON THE ACTUAL FORM...

Private Sub TitleBarToddle_Click()

    If TitleBarToddle.Value = False Then
    Call WinCall.ChangeBorderStyle(MyState = False, MyFormName = "Color Manager Tools")
    Else
    Call WinCall.ChangeBorderStyle(MyState = True, MyFormName = "Color Manager Tools")
    End If
End Sub
Any reason why doing this should be a problem...

WindowHandle = FindWindow(vbNullString, MyFormName)


Yani
Reply With Quote
  #24  
Old 20-03-2006, 10:41
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Quote:
Originally Posted by akayani
WindowHandle = FindWindow(vbNullString, MyFormName)
Well, it is still better to specify the window class as well, as mentioned earlier. Just to eliminate a chance of picking a wrong window (with the same caption).

Also I guess if you want to call function and pass parameters through named arguments you need to use := instead of just =.

That is, instead of:

Code:
Call WinCall.ChangeBorderStyle(MyState = False, MyFormName = "Color Manager Tools")
You need to actually call:

Code:
Call WinCall.ChangeBorderStyle(MyState:= False, MyFormName:= "Color Manager Tools")
or simply do it the easy way:

Code:
WinCall.ChangeBorderStyle False, "Color Manager Tools"
Same thing, but shorter
Reply With Quote
  #25  
Old 20-03-2006, 10:54
akayani
Guest
 
Posts: n/a
Default

Bang on Alex...

Thanks for being so prompt.

Yani
Reply With Quote
  #26  
Old 20-03-2006, 22:52
SteveDude SteveDude is offline
Senior Member
 
Join Date: Dec 2005
Location: Salina, Kansas USA
Posts: 149
Default Dockers...

You're about half way there to making docking/sliding forms a reality. I'll post more when I get a chance. Got a lot on my plate.
Reply With Quote
  #27  
Old 20-03-2006, 23:50
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,770
Blog Entries: 10
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 Example

For those of wondering what this code it doing here is an example:

Hope it helps,

Shelby

****Edit****

Ok I was ask to post a GMS of this so here it is.
Attached Images
  
Attached Files
File Type: gms FrameLess.gms (30.5 KB, 249 views)

Last edited by shelbym; 21-03-2006 at 18:57.
Reply With Quote
  #28  
Old 21-03-2006, 05:56
Booker
Guest
 
Posts: n/a
Default

Shelby,

Thats nice. Mind posting the gms of it?


**** Thanks ShelbyM !!

Last edited by Booker; 22-03-2006 at 17:43.
Reply With Quote
  #29  
Old 22-03-2006, 06:11
akayani
Guest
 
Posts: n/a
Default

Here ya go have a play with this...

It's not a finished macro but there is enough in it to see how this works...

Note that I'm using a pic on the left edge of the form to do movement. There were too many objects on the form getting in the way of the background to be able to use "userform" effectively.

Yani
Attached Files
File Type: gms QuickTune.gms (76.0 KB, 251 views)
Reply With Quote
  #30  
Old 22-03-2006, 07:49
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,770
Blog Entries: 10
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 QuickTune

Pretty darn cool. Love the handle on the left so you can move it were ever you like. Well done.

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
Adding controls to forms at runtime ddonnahoe CorelDRAW/Corel DESIGNER VBA 15 20-12-2005 13:59
Dockable Forms? Jon Lorber CorelDRAW/Corel DESIGNER VBA 3 16-02-2005 14:51


All times are GMT -5. The time now is 12:02.


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