
View Message Thread (15 replies)
| Changing Form's BorderStyle property at run time but before form is loaded |
 |
From: Claire Date Posted: 5/6/2010 3:08:00 PM
Hello,
Is there any workaround to change the form's BorderStyle property
before the form is loaded?
I need to change it from None to Fixed Single depending on user's
preferences.
That form is not the main form of the project.
Your thoughts appreciated,
Claire

| Changing Form's BorderStyle property at run time but before form is loaded |
|
From: Claire Date Posted: 5/6/2010 3:09:00 PM
Hello,
Is there any workaround to change the form's BorderStyle property
before the form is loaded?
I need to change it from None to Fixed Single depending on user's
preferences.
That form is not the main form of the project.
Your thoughts appreciated,
Claire

| Re: Changing Form's BorderStyle property at run time but before form is loaded |
|
From: Karl E. Peterson Date Posted: 5/6/2010 3:42:00 PM
Claire wrote:
> Is there any workaround to change the form's BorderStyle property
> before the form is loaded?
> I need to change it from None to Fixed Single depending on user's
> preferences.
Technically, not before it's loaded, but you can change it during the
Form_Load event using the techniques demonstrated here:
http://vb.mvps.org/samples/FormBdr
--
..NET: It's About Trust!
http://vfred.mvps.org

| Re: Changing Form's BorderStyle property at run time but before form is loaded |
|
From: Karl E. Peterson Date Posted: 5/6/2010 3:44:00 PM
Claire wrote:
> Is there any workaround to change the form's BorderStyle property
> before the form is loaded?
> I need to change it from None to Fixed Single depending on user's
> preferences.
Technically, not before it's loaded, but you can change it during the
Form_Load event using the techniques demonstrated here:
http://vb.mvps.org/samples/FormBdr
--
..NET: It's About Trust!
http://vfred.mvps.org

| Re: Changing Form's BorderStyle property at run time but before form is loaded |
|
From: Mike Williams Date Posted: 5/6/2010 3:54:00 PM
"Claire" <replyto@fra> wrote in message
news:%23i%236t$V7KHA.3504@TK2MSFTNGP05.phx.gbl...
> Is there any workaround to change the form's BorderStyle
> property before the form is loaded? I need to change it from
> None to Fixed Single depending on user's preferences.
> That form is not the main form of the project.
Don't know if you actually do mean "before the form is loaded". You can
change its BorderStyle after it loads, or as it loads:
Dim oldStyle As Long
oldStyle = GetWindowLong(Form2.hwnd, GWL_STYLE)
SetWindowLong Form2.hwnd, GWL_STYLE, oldStyle _
And Not WS_THICKFRAME
SetWindowPos Form2.hwnd, 0, 0, 0, 0, 0, _
SWP_FRAMECHANGED Or SWP_NOMOVE Or _
SWP_NOZORDER Or SWP_NOSIZE
Form2.Show
Mike

| Re: Changing Form's BorderStyle property at run time but before form is loaded |
|
From: Mike Williams Date Posted: 5/6/2010 3:56:00 PM
"Claire" <replyto@fra> wrote in message
news:%23i%236t$V7KHA.3504@TK2MSFTNGP05.phx.gbl...
> Is there any workaround to change the form's BorderStyle
> property before the form is loaded? I need to change it from
> None to Fixed Single depending on user's preferences.
> That form is not the main form of the project.
Don't know if you actually do mean "before the form is loaded". You can
change its BorderStyle after it loads, or as it loads:
Dim oldStyle As Long
oldStyle = GetWindowLong(Form2.hwnd, GWL_STYLE)
SetWindowLong Form2.hwnd, GWL_STYLE, oldStyle _
And Not WS_THICKFRAME
SetWindowPos Form2.hwnd, 0, 0, 0, 0, 0, _
SWP_FRAMECHANGED Or SWP_NOMOVE Or _
SWP_NOZORDER Or SWP_NOSIZE
Form2.Show
Mike

| Re: Changing Form's BorderStyle property at run time but before form is loaded |
|
From: Claire Date Posted: 5/6/2010 5:35:00 PM
Thank you Karl and Mike.
It does work perfectly.
Claire
"Claire" <replyto@fra> wrote in message
news:%23i%236t$V7KHA.3504@TK2MSFTNGP05.phx.gbl...
> Hello,
> Is there any workaround to change the form's BorderStyle property
> before the form is loaded?
> I need to change it from None to Fixed Single depending on user's
> preferences.
> That form is not the main form of the project.
> Your thoughts appreciated,
> Claire
>

| Re: Changing Form's BorderStyle property at run time but before form is loaded |
|
From: Claire Date Posted: 5/6/2010 5:36:00 PM
Thank you Karl and Mike.
It does work perfectly.
Claire
"Claire" <replyto@fra> wrote in message
news:%23i%236t$V7KHA.3504@TK2MSFTNGP05.phx.gbl...
> Hello,
> Is there any workaround to change the form's BorderStyle property
> before the form is loaded?
> I need to change it from None to Fixed Single depending on user's
> preferences.
> That form is not the main form of the project.
> Your thoughts appreciated,
> Claire
>

| Re: Changing Form's BorderStyle property at run time but before form is loaded |
|
From: Claire Date Posted: 5/6/2010 5:52:00 PM
Almost done but I need to disable (grayed) X
How to do that?
Thanks,
Claire
"Claire" <replyto@fra> wrote in message
news:%23c8tkSX7KHA.3924@TK2MSFTNGP04.phx.gbl...
> Thank you Karl and Mike.
> It does work perfectly.
> Claire
>
> "Claire" <replyto@fra> wrote in message
> news:%23i%236t$V7KHA.3504@TK2MSFTNGP05.phx.gbl...
>> Hello,
>> Is there any workaround to change the form's BorderStyle
>> property before the form is loaded?
>> I need to change it from None to Fixed Single depending on user's
>> preferences.
>> That form is not the main form of the project.
>> Your thoughts appreciated,
>> Claire
>>
>
>

| Re: Changing Form's BorderStyle property at run time but before form is loaded |
|
From: Claire Date Posted: 5/6/2010 5:53:00 PM
Almost done but I need to disable (grayed) X
How to do that?
Thanks,
Claire
"Claire" <replyto@fra> wrote in message
news:%23c8tkSX7KHA.3924@TK2MSFTNGP04.phx.gbl...
> Thank you Karl and Mike.
> It does work perfectly.
> Claire
>
> "Claire" <replyto@fra> wrote in message
> news:%23i%236t$V7KHA.3504@TK2MSFTNGP05.phx.gbl...
>> Hello,
>> Is there any workaround to change the form's BorderStyle
>> property before the form is loaded?
>> I need to change it from None to Fixed Single depending on user's
>> preferences.
>> That form is not the main form of the project.
>> Your thoughts appreciated,
>> Claire
>>
>
>

Would you like to track this thread?
By adding this News Thread to your Favorites Area you can refer to it later with just a click of the mouse.
Also you can optionally be notified instantly whenever there are any replies
posted to this Thread. To add this Thread to your Favorites Area just click on the red arrow next to the subject of the thread above
.
|