PC Review


Reply
Thread Tools Rate Thread

CreateGraphics() ==> NotSupportedExpeption

 
 
baramuse
Guest
Posts: n/a
 
      8th Sep 2004
hi

I try to mesure the width of a string in a listbox to autoadjust its
size. But when i call the CreateGraphic methode of the list (either of
the panel that contains it) I get an NotSupportedExeption...
I'm running my soft on an WindowsCE 4.2 device (Gotive H41) and
developping with vs.net 2003.

thanks a lot.
 
Reply With Quote
 
 
 
 
Chris Tacke, eMVP
Guest
Posts: n/a
 
      8th Sep 2004
CreateGraphics is supported only on Control and I think PictureBox.


-Chris


"baramuse" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> hi
>
> I try to mesure the width of a string in a listbox to autoadjust its
> size. But when i call the CreateGraphic methode of the list (either of
> the panel that contains it) I get an NotSupportedExeption...
> I'm running my soft on an WindowsCE 4.2 device (Gotive H41) and
> developping with vs.net 2003.
>
> thanks a lot.



 
Reply With Quote
 
baramuse
Guest
Posts: n/a
 
      8th Sep 2004
Chris Tacke, eMVP wrote:

> CreateGraphics is supported only on Control and I think PictureBox.
>
>
> -Chris
>
>
> "baramuse" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>
>>hi
>>
>>I try to mesure the width of a string in a listbox to autoadjust its
>>size. But when i call the CreateGraphic methode of the list (either of
>>the panel that contains it) I get an NotSupportedExeption...
>>I'm running my soft on an WindowsCE 4.2 device (Gotive H41) and
>>developping with vs.net 2003.
>>
>>thanks a lot.

>
>
>

Oh.. ok then
how would you recommand me to mesure my string then? :s
It means that I couldn't draw anything in a panel after the OnDraw
methode is called? -sighhh-

thanks a lot anyway
 
Reply With Quote
 
Chris Tacke, eMVP
Guest
Posts: n/a
 
      8th Sep 2004
Use the OnPaint's Graphics object to measure.

-Chris


"baramuse" <(E-Mail Removed)> wrote in message
news:u2%(E-Mail Removed)...
> Chris Tacke, eMVP wrote:
>
> > CreateGraphics is supported only on Control and I think PictureBox.
> >
> >
> > -Chris
> >
> >
> > "baramuse" <(E-Mail Removed)> wrote in message
> > news:%(E-Mail Removed)...
> >
> >>hi
> >>
> >>I try to mesure the width of a string in a listbox to autoadjust its
> >>size. But when i call the CreateGraphic methode of the list (either of
> >>the panel that contains it) I get an NotSupportedExeption...
> >>I'm running my soft on an WindowsCE 4.2 device (Gotive H41) and
> >>developping with vs.net 2003.
> >>
> >>thanks a lot.

> >
> >
> >

> Oh.. ok then
> how would you recommand me to mesure my string then? :s
> It means that I couldn't draw anything in a panel after the OnDraw
> methode is called? -sighhh-
>
> thanks a lot anyway



 
Reply With Quote
 
David D Webb
Guest
Posts: n/a
 
      8th Sep 2004
Its supported on the form. Just do:
Graphics g = this.CreateGraphics();
for any form class. Be sure to dispose it manually.

-Dave




 
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
CreateGraphics help in VB.net bromptonville-un@yahoo.com Microsoft VB .NET 3 29th Dec 2007 03:47 AM
CreateGraphics =?Utf-8?B?SGFpcGluZw==?= Microsoft Dot NET 4 14th Aug 2007 07:26 PM
CreateGraphics Jon Shemitz Microsoft Dot NET Framework Forms 5 6th Oct 2004 02:58 PM
Re: g=this.CreateGraphics(); not possible, why? Jonathan Wells [msft] Microsoft Dot NET Compact Framework 0 25th Nov 2003 05:54 PM
CreateGraphics Peter Bladh Microsoft Dot NET Compact Framework 1 21st Oct 2003 02:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:44 AM.