50,236 Members
2 added today
248,628 Resources
73 added today

All Devdex   All XMLdex   Current Category
XMLdex > Forums & Newsgroups > Newsgroups > microsoft.public.dotnet.xml Add this category to My Favorites

View Message Thread  (15 replies)

Results 1 - 10 of 16 Next Page »

Changing Form's BorderStyle property at run time but before form is loaded Add this thread to My Favorites
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
>>
>
>

Results 1 - 10 of 16 Next Page »

 

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 Add this thread to My Favorites.



ASP.NET Chart Control.
Charts from your Database.
Live Demo & FREE Trial!

ASP ArticlesThis category has been added to your weekly newsletter
ASP Web Sites
ADSI & WSH BooksThis category has been added to your weekly newsletter
FREE ComponentsThis category has been added to your weekly newsletter
ASP EventsThis category has been added to your weekly newsletter
ASP HeadlinesThis category has been added to your weekly newsletter

CSharp ArticlesThis category has been added to your weekly newsletter
C# Web SitesThis category has been added to your weekly newsletter

SQL ArticlesThis category has been added to your weekly newsletter
SQL Events
SQL HeadlinesThis category has been added to your weekly newsletter
SQL Jobs

Jobs in CaliforniaThis category has been added to your weekly newsletter

XML ArticlesThis category has been added to your weekly newsletter
XML BooksThis category has been added to your weekly newsletter
XML Web Sites
XML Tutorials

free asp host

"Alex Homer"This search has been added to your weekly newsletter

Edit My Favorites Edit Profile & Favorites

 

 

 

 

 




Developersdex Home | ASP | C# | SQL | VB | XML | Gurus
Add Your Link | Add Your Code | FAQ | Advertise | Link To Us | Contact Us |
Copyright © 2010 Developersdex™. All rights reserved.