Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2004

Tip: Looking for answers? Try searching our database.

PictureBox and SystemIcons

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dan S - 22 Jul 2004 19:47 GMT
I have a form on which I want to display one of Icons from the SystemIcons class.  I have done so using a PictureBox, something like...

PictureBox pictureBox = new PictureBox();
...
pictureBox.Image = SystemIcons.Question.ToBitmap();

This does display the Icon but it is a bit 'choppy' and simply does not look as nice as when the same icon is displayed using MessageBox.Show( ...., MessageBoxIcons.Question, ...)  

Any ideas?  Is there a better way to do this?  Something besides the PictureBox class.

Signature

Dan S

Herfried K. Wagner [MVP] - 22 Jul 2004 20:14 GMT
* "=?Utf-8?B?RGFuIFM=?=" <DanS@discussions.microsoft.com> scripsit:
> I have a form on which I want to display one of Icons from the SystemIcons class.  I have done so using a PictureBox, something like...
>
[quoted text clipped - 3 lines]
>
> This does display the Icon but it is a bit 'choppy' and simply does not look as nice as when the same icon is displayed using MessageBox.Show( ...., MessageBoxIcons.Question, ...)  

<URL:http://dotnetrix.co.uk/>
-> "Tips" -> "Misc..."

Signature

Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/

Wiktor Zychla - 23 Jul 2004 12:39 GMT
> This does display the Icon but it is a bit 'choppy' and simply does not look as nice as when the same icon is displayed using MessageBox.Show( ....,
MessageBoxIcons.Question, ...)

are you sure that the PictureBox does not automatically scale the icon image
to its own size? if it is so then the icon could really look ugly. make sure
that the picture box size is the same as the icon beeing painted. another
solution would be to override form's OnPaint and paint the icon directly on
the form using Graphics.DrawImageUnscaled(...).

regards,
Wiktor Zychla

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.