PC Review


Reply
Thread Tools Rate Thread

Transparent button

 
 
=?Utf-8?B?anVhbkBtc2RuQ29tcGFueS5jb20=?=
Guest
Posts: n/a
 
      8th Mar 2007
I am trying to create a transparent button, subclassing from control. I
cannot seem to get it to work and its led me to ask a few questions.

1) How do we set styles in the compact framework? What is the replacement
for CreateParams that you can use on the desktop? I can do a pInvoke to set
the style, but you get into the problem where the style needs to be set once
you get a window handle and before it is activated and as a control I am not
sure you know when that is.

2) Is there somewhere you can go to know how to do something that is not
supported in the compact framework, but is supported in the full framework?
All you know from the help is which methods are supported by the compact
framework, but it would be really nice to know what replacement (pInvoke or
other class) is expected to be used as the replacement.

3) Does Windows Mobile 5 support the WS_EX_TRANSPARENT exStyle?
--
Thanks,
Juan
 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      8th Mar 2007
> 1) How do we set styles in the compact framework? What is the replacement
> for CreateParams that you can use on the desktop? I can do a pInvoke to
> set
> the style, but you get into the problem where the style needs to be set
> once
> you get a window handle and before it is activated and as a control I am
> not
> sure you know when that is.


P/Invoke is the only way. You can override OnHandleCreated:

protected override void OnHandleCreated(EventArgs e)
{
base.OnHandleCreated(e);
// p/invoke with this.Handle
}


> 2) Is there somewhere you can go to know how to do something that is not
> supported in the compact framework, but is supported in the full
> framework?
> All you know from the help is which methods are supported by the compact
> framework, but it would be really nice to know what replacement (pInvoke
> or
> other class) is expected to be used as the replacement.


Since the CF is a pretty small subset that would be a giant task. Putting
together the "workarounds" would essentially be writing another .NET
Framework. OpenNETCF's SDF has a lot of work in it and with it you're still
nowhere near the full framework.

> 3) Does Windows Mobile 5 support the WS_EX_TRANSPARENT exStyle?


No. It's not in winuser.h so that leads me to believe the OS doesn't
support it. It is defined in the MFC source, but that's probably just a
copy leftover from the desktop.


--
Chris Tacke - Embedded MVP
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--




 
Reply With Quote
 
=?Utf-8?B?anVhbkBtc2RuQ29tcGFueS5jb20=?=
Guest
Posts: n/a
 
      10th Mar 2007
Thanks for the reply. Yes, I see your point on the workarounds. Just
explaining how to do the workarounds would be a major task, but sometimes
just a little direction could help tremendously.
--
Thanks again for the help,
Juan


"<ctacke/>" wrote:

> > 1) How do we set styles in the compact framework? What is the replacement
> > for CreateParams that you can use on the desktop? I can do a pInvoke to
> > set
> > the style, but you get into the problem where the style needs to be set
> > once
> > you get a window handle and before it is activated and as a control I am
> > not
> > sure you know when that is.

>
> P/Invoke is the only way. You can override OnHandleCreated:
>
> protected override void OnHandleCreated(EventArgs e)
> {
> base.OnHandleCreated(e);
> // p/invoke with this.Handle
> }
>
>
> > 2) Is there somewhere you can go to know how to do something that is not
> > supported in the compact framework, but is supported in the full
> > framework?
> > All you know from the help is which methods are supported by the compact
> > framework, but it would be really nice to know what replacement (pInvoke
> > or
> > other class) is expected to be used as the replacement.

>
> Since the CF is a pretty small subset that would be a giant task. Putting
> together the "workarounds" would essentially be writing another .NET
> Framework. OpenNETCF's SDF has a lot of work in it and with it you're still
> nowhere near the full framework.
>
> > 3) Does Windows Mobile 5 support the WS_EX_TRANSPARENT exStyle?

>
> No. It's not in winuser.h so that leads me to believe the OS doesn't
> support it. It is defined in the MFC source, but that's probably just a
> copy leftover from the desktop.
>
>
> --
> Chris Tacke - Embedded MVP
> OpenNETCF Consulting
> Managed Code in the Embedded World
> www.opennetcf.com
> --
>
>
>
>
>

 
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
Transparent button Frank Rizzo Microsoft C# .NET 2 7th May 2008 09:25 PM
Image transparent and a button djamila Microsoft C# .NET 0 17th Apr 2008 08:37 PM
Transparent button Steve Microsoft Excel Programming 5 11th Jan 2008 08:22 AM
Re: transparent bg in hover button... E. T. Culling Microsoft Frontpage 0 8th Jun 2004 07:39 PM
Re: transparent bg in hover button... Thomas A. Rowe Microsoft Frontpage 0 8th Jun 2004 05:03 PM


Features
 

Advertising
 

Newsgroups
 


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