.Net Compact Framework for Pocket PC 2003 SE

G

Guest

Hello,

Recently, I develop an application using .net compact framework for Pocket
PC 2003 SE. However, the image of icon on toolbar cannot be displayed in
either emulator or physical HW. I tried to change the size and format of the
image, but it cannot still be shown. How can I solve this problem?

Thanks a lot
 
N

Neville Lang

In addition to Peter's link that explains why there is a difference for SE
for the ToolBar ImageList, you do need to change your present code
especially if you have created the ToolBar button image list assignment
using the Designer, like I did.

In SE, it seems there are a number of things that will break the linkage
from the ToolBar to the ImageList, after the Designer has set it. Even
worse, once it is broken, it can never be re-assigned at runtime. This is
something I picked up on a post in Google. I never actually tested this
myself but if it is true then maybe the MS team needs to fix this up.

What I did was code around the problem since some of my customers now have
the Dell Axim X30 that has the Windows Mobile 2003 SE loaded.

Here is how I solved the problem in my app in case it is helpful to you:

i) Using Designer, blank out the ToolBar's ImageList property. This breaks
this link in the Designer ready for your code.
ii) Create a new method on your MainForm, an example is shown below.

private void SetToolBar()
{
// From my information, this can only be set once per
// app session. Re-assigning it at runtime does not work
this.myToolBar.ImageList = this.myImageList;

// The ImageIndexes always need to follow the assignment of the
ImageList
this.myToolBarButton1.ImageIndex = 0;
this.myToolBarButton2.ImageIndex = 1;
...
...
}


iii) Though the next thing I did is poor code, I intend fixing it up next
time. In the Windows Form Designer generated code of the MainForm, I simply
commented out the ImageIndex assignments that were moved to the above
method. The reason we know this is poor style is that every time you make a
change in the Designer on this form, this code gets refreshed and so you
will lose the commenting out of the ImageIndex assignments. For the long
term, it is probably advisable to move all of the ToolBarButton creation and
property assignments out of the Designer and into that new method.

iii) Finally, you need to place the call to SetToolBar() at the very end of
the MainForm's constructor. That way, it ensures that some of the Form's
property settings that can break the ImageList assignment are processed
before the call.


After implementing this code change, the ToolBar images in my app now work
correctly on PPC 2002, WM2003 and WM2003 SE.

Regards,
Neville Lang
 
S

Serg Kuryata [MS]

The workaround provided by Neville is correct. Another thing that you can
do is to set the ToolBar.ImageList property to null before doing anything
that can cause the native toolbar control to destroy its image list and
then restore the property to the original value when you are done.

Thank you,
Sergiy.

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Reply-To: "Neville Lang" <neville@MAPS_ONnjlsoftware.com>
| From: "Neville Lang" <neville@MAPS_ONnjlsoftware.com>
| References: <[email protected]>
<uPQN#[email protected]>
| Subject: Re: .Net Compact Framework for Pocket PC 2003 SE
| Date: Fri, 1 Oct 2004 10:33:29 +1000
| Lines: 94
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: cpe-144-136-29-110.vic.bigpond.net.au 144.136.29.110
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:62364
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
|
| In addition to Peter's link that explains why there is a difference for
SE
| for the ToolBar ImageList, you do need to change your present code
| especially if you have created the ToolBar button image list assignment
| using the Designer, like I did.
|
| In SE, it seems there are a number of things that will break the linkage
| from the ToolBar to the ImageList, after the Designer has set it. Even
| worse, once it is broken, it can never be re-assigned at runtime. This is
| something I picked up on a post in Google. I never actually tested this
| myself but if it is true then maybe the MS team needs to fix this up.
|
| What I did was code around the problem since some of my customers now have
| the Dell Axim X30 that has the Windows Mobile 2003 SE loaded.
|
| Here is how I solved the problem in my app in case it is helpful to you:
|
| i) Using Designer, blank out the ToolBar's ImageList property. This breaks
| this link in the Designer ready for your code.
| ii) Create a new method on your MainForm, an example is shown below.
|
| private void SetToolBar()
| {
| // From my information, this can only be set once per
| // app session. Re-assigning it at runtime does not work
| this.myToolBar.ImageList = this.myImageList;
|
| // The ImageIndexes always need to follow the assignment of the
| ImageList
| this.myToolBarButton1.ImageIndex = 0;
| this.myToolBarButton2.ImageIndex = 1;
| ...
| ...
| }
|
|
| iii) Though the next thing I did is poor code, I intend fixing it up next
| time. In the Windows Form Designer generated code of the MainForm, I
simply
| commented out the ImageIndex assignments that were moved to the above
| method. The reason we know this is poor style is that every time you make
a
| change in the Designer on this form, this code gets refreshed and so you
| will lose the commenting out of the ImageIndex assignments. For the long
| term, it is probably advisable to move all of the ToolBarButton creation
and
| property assignments out of the Designer and into that new method.
|
| iii) Finally, you need to place the call to SetToolBar() at the very end
of
| the MainForm's constructor. That way, it ensures that some of the Form's
| property settings that can break the ImageList assignment are processed
| before the call.
|
|
| After implementing this code change, the ToolBar images in my app now work
| correctly on PPC 2002, WM2003 and WM2003 SE.
|
| Regards,
| Neville Lang
|
|
|
| | > There is an explaination of this behaviour here:-
| > http://blogs.msdn.com/windowsmobile/archive/2004/08/03/207311.aspx
| > This is a change from previous releases of Pocket PC
| >
| > Peter
| >
| > --
| > Peter Foot
| > Windows Embedded MVP
| > www.inthehand.com | www.opennetcf.org
| >
| > Do have an opinion on the effectiveness of Microsoft Windows Mobile and
| > Embedded newsgroups? Let us know!
| > https://www.windowsembeddedeval.com/community/newsgroups
| >
message
| > | > > Hello,
| > >
| > > Recently, I develop an application using .net compact framework for
| Pocket
| > > PC 2003 SE. However, the image of icon on toolbar cannot be displayed
in
| > > either emulator or physical HW. I tried to change the size and format
of
| > > the
| > > image, but it cannot still be shown. How can I solve this problem?
| > >
| > > Thanks a lot
| > >
| > >
| >
| >
|
|
|
 
S

Serg Kuryata [MS]

Yes, this issue has been fixed in the .NET Compact Framework SP3.

Thank you,
Sergiy.

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Thread-Topic: .Net Compact Framework for Pocket PC 2003 SE
| thread-index: AcT/CLFCBWnGl0KnTGmc/2fGYw06iQ==
| X-WBNR-Posting-Host: 62.216.9.7
| From: "=?Utf-8?B?YWxmYQ==?=" <[email protected]>
| References: <[email protected]>
| Subject: RE: .Net Compact Framework for Pocket PC 2003 SE
| Date: Thu, 20 Jan 2005 07:57:07 -0800
| Lines: 15
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.compactframework:69227
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| When you run the SP3 you'll have your thing. It will work as it should
work
| Wim
|
| "developer4now" wrote:
|
| > Hello,
| >
| > Recently, I develop an application using .net compact framework for
Pocket
| > PC 2003 SE. However, the image of icon on toolbar cannot be displayed
in
| > either emulator or physical HW. I tried to change the size and format
of the
| > image, but it cannot still be shown. How can I solve this problem?
| >
| > Thanks a lot
| >
| >
|
 
M

Martin

Hello everybody

nice workaround of this bug but does anybody know how to display the
form icon on a form but more important on the taskbar of the windows
ce? I read some articles that it is not possible to set a customer
icon (but in my taskbar not even the default icon is shown). I am
using the Windows CE Emulator Version 4.1.0. Anybody has an idea?

thanks a lot!

martin
 
S

Serg Kuryata [MS]

I believe you can do it using the Form.Icon property. It should work if
your target OS is generic Windows CE (not PPC or Smartphone).

Hope this helps.
Thank you,
Sergiy.

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| From: (e-mail address removed) (Martin)
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Subject: Re: .Net Compact Framework for Pocket PC 2003 SE
| Date: 11 Feb 2005 05:09:34 -0800
| Organization: http://groups.google.com
| Lines: 11
| Message-ID: <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
| NNTP-Posting-Host: 200.80.35.254
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google.com 1108127375 30962 127.0.0.1 (11 Feb 2005
13:09:35 GMT)
| X-Complaints-To: (e-mail address removed)
| NNTP-Posting-Date: Fri, 11 Feb 2005 13:09:35 +0000 (UTC)
| Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!news.glorb.com!postnews.google.com!not-for-mail
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.compactframework:22378
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hello everybody
|
| nice workaround of this bug but does anybody know how to display the
| form icon on a form but more important on the taskbar of the windows
| ce? I read some articles that it is not possible to set a customer
| icon (but in my taskbar not even the default icon is shown). I am
| using the Windows CE Emulator Version 4.1.0. Anybody has an idea?
|
| thanks a lot!
|
| martin
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top