PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Transparent button

Reply

Transparent button

 
Thread Tools Rate Thread
Old 08-03-2007, 02:14 PM   #1
=?Utf-8?B?anVhbkBtc2RuQ29tcGFueS5jb20=?=
Guest
 
Posts: n/a
Default Transparent button


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
Old 08-03-2007, 02:25 PM   #2
Guest
 
Posts: n/a
Default Re: Transparent button

> 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
Old 10-03-2007, 05:35 PM   #3
=?Utf-8?B?anVhbkBtc2RuQ29tcGFueS5jb20=?=
Guest
 
Posts: n/a
Default Re: Transparent button

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off