CreateGraphics() ==> NotSupportedExpeption

  • Thread starter Thread starter baramuse
  • Start date Start date
B

baramuse

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.
 
CreateGraphics is supported only on Control and I think PictureBox.


-Chris
 
CreateGraphics is supported only on Control and I think PictureBox.


-Chris
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 :)
 
Its supported on the form. Just do:
Graphics g = this.CreateGraphics();
for any form class. Be sure to dispose it manually.

-Dave
 
Back
Top