PC Review


Reply
Thread Tools Rate Thread

border on userforms

 
 
=?Utf-8?B?bmV3X3RvX3ZiYQ==?=
Guest
Posts: n/a
 
      13th Nov 2006
how do i remove the blue border around a userform. so all you see is the form
itself?

all help appreciated
 
Reply With Quote
 
 
 
 
Michel Pierron
Guest
Posts: n/a
 
      13th Nov 2006
Hi new_to_vba,
It is not possible if you wish to preserve the title bar UserForm.

MP

"new_to_vba" <(E-Mail Removed)> a écrit dans le message
de news: FE748055-DCC2-4445-86D9-(E-Mail Removed)...
> how do i remove the blue border around a userform. so all you see is the
> form
> itself?
>
> all help appreciated



 
Reply With Quote
 
=?Utf-8?B?bmV3X3RvX3ZiYQ==?=
Guest
Posts: n/a
 
      13th Nov 2006
Hi Michel Pierron,
No i do not need to keep the title bar.

"Michel Pierron" wrote:

> Hi new_to_vba,
> It is not possible if you wish to preserve the title bar UserForm.
>
> MP
>
> "new_to_vba" <(E-Mail Removed)> a écrit dans le message
> de news: FE748055-DCC2-4445-86D9-(E-Mail Removed)...
> > how do i remove the blue border around a userform. so all you see is the
> > form
> > itself?
> >
> > all help appreciated

>
>
>

 
Reply With Quote
 
Michel Pierron
Guest
Posts: n/a
 
      13th Nov 2006
In the UserForm module:

Private Declare Function FindWindow& Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName$, ByVal lpWindowName$)
Private Declare Function SetWindowLong& Lib "user32" _
Alias "SetWindowLongA" (ByVal hWnd&, ByVal nIndex& _
, ByVal wNewWord&)
' If you want to be able to move UserForm
Private Declare Function ReleaseCapture& Lib "user32" ()
Private Declare Function SendMessage& Lib "user32" _
Alias "SendMessageA" (ByVal hWnd&, ByVal wMsg& _
, ByVal wParam%, ByVal lParam As Any)

Private hWnd&

' You need a button to close UserForm
Private Sub CommandButton1_Click()
Unload Me
End Sub

Private Sub UserForm_Initialize()
' Title bar is a skin -> resize UserForm dimensions
Me.Height = Me.InsideHeight + ((Me.Width - Me.InsideWidth) / 2)
Me.Width = Me.InsideWidth
hWnd = FindWindow(vbNullString, Me.Caption)
SetWindowLong hWnd, -16, &H84080080 ' No caption
SetWindowLong hWnd, -20, &H40000 ' No borders
End Sub

' If you want to be able to move UserForm
Private Sub UserForm_MouseDown(ByVal Button%, ByVal Shift%, ByVal X!, ByVal
Y!)
ReleaseCapture
SendMessage hWnd, &HA1, 2, 0&
End Sub

Regards,
MP


"new_to_vba" <(E-Mail Removed)> a écrit dans le message de
news: C4087450-F73B-4117-BD4E-(E-Mail Removed)...
> Hi Michel Pierron,
> No i do not need to keep the title bar.
>
> "Michel Pierron" wrote:
>
>> Hi new_to_vba,
>> It is not possible if you wish to preserve the title bar UserForm.
>>
>> MP
>>
>> "new_to_vba" <(E-Mail Removed)> a écrit dans le
>> message
>> de news: FE748055-DCC2-4445-86D9-(E-Mail Removed)...
>> > how do i remove the blue border around a userform. so all you see is
>> > the
>> > form
>> > itself?
>> >
>> > all help appreciated

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?bmV3X3RvX3ZiYQ==?=
Guest
Posts: n/a
 
      13th Nov 2006
Thank you very much for that i will try it later as i have to leave the
project for
today. I cant thank you enough without people like you i would be totally
lost.
regards Nick.

"Michel Pierron" wrote:

> In the UserForm module:
>
> Private Declare Function FindWindow& Lib "user32" Alias _
> "FindWindowA" (ByVal lpClassName$, ByVal lpWindowName$)
> Private Declare Function SetWindowLong& Lib "user32" _
> Alias "SetWindowLongA" (ByVal hWnd&, ByVal nIndex& _
> , ByVal wNewWord&)
> ' If you want to be able to move UserForm
> Private Declare Function ReleaseCapture& Lib "user32" ()
> Private Declare Function SendMessage& Lib "user32" _
> Alias "SendMessageA" (ByVal hWnd&, ByVal wMsg& _
> , ByVal wParam%, ByVal lParam As Any)
>
> Private hWnd&
>
> ' You need a button to close UserForm
> Private Sub CommandButton1_Click()
> Unload Me
> End Sub
>
> Private Sub UserForm_Initialize()
> ' Title bar is a skin -> resize UserForm dimensions
> Me.Height = Me.InsideHeight + ((Me.Width - Me.InsideWidth) / 2)
> Me.Width = Me.InsideWidth
> hWnd = FindWindow(vbNullString, Me.Caption)
> SetWindowLong hWnd, -16, &H84080080 ' No caption
> SetWindowLong hWnd, -20, &H40000 ' No borders
> End Sub
>
> ' If you want to be able to move UserForm
> Private Sub UserForm_MouseDown(ByVal Button%, ByVal Shift%, ByVal X!, ByVal
> Y!)
> ReleaseCapture
> SendMessage hWnd, &HA1, 2, 0&
> End Sub
>
> Regards,
> MP
>
>
> "new_to_vba" <(E-Mail Removed)> a écrit dans le message de
> news: C4087450-F73B-4117-BD4E-(E-Mail Removed)...
> > Hi Michel Pierron,
> > No i do not need to keep the title bar.
> >
> > "Michel Pierron" wrote:
> >
> >> Hi new_to_vba,
> >> It is not possible if you wish to preserve the title bar UserForm.
> >>
> >> MP
> >>
> >> "new_to_vba" <(E-Mail Removed)> a écrit dans le
> >> message
> >> de news: FE748055-DCC2-4445-86D9-(E-Mail Removed)...
> >> > how do i remove the blue border around a userform. so all you see is
> >> > the
> >> > form
> >> > itself?
> >> >
> >> > all help appreciated
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
page border problems bottom border missing mikeeeee Microsoft Word Document Management 0 12th Oct 2009 09:31 AM
re-post border on userforms =?Utf-8?B?bmV3X3RvX3ZiYQ==?= Microsoft Excel Programming 8 20th Nov 2006 02:44 AM
Changing the border of one cell s/n change the border of adjacent =?Utf-8?B?Z2phbnNzZW5tbg==?= Microsoft Excel Misc 2 5th Oct 2005 08:35 PM
Body of page appears in Top Border, Left Border and Bottom Border (there is no right border) Michael Edwards Microsoft Frontpage 1 14th Oct 2004 09:46 AM
Re: Want black vertical border to show up over gray horizontal border CLR Microsoft Excel Misc 0 15th Jul 2004 07:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:12 PM.