Is there an Icon control?

  • Thread starter Thread starter Jacob
  • Start date Start date
J

Jacob

What's the best way to put an Icon in the client area of a form (not in the
ControlBox)? Everything I've tried seems to produce unsatisfactory results.
A picture box doesn't give me the icon size I want. I've been using a
PictureBox, hooking its Paint event and doing it manually. Is there a better
way?


Thanks,
Jacob
 
Jacob,

If the picture box doesn't give you what you want, have you considered
painting the icons yourself?

Hope this helps.
 
Ya, as I mentioned.... that's what I've been doing. Anything else?

Thanks,
Jacob




Nicholas Paldino said:
Jacob,

If the picture box doesn't give you what you want, have you considered
painting the icons yourself?

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Jacob said:
What's the best way to put an Icon in the client area of a form (not in
the ControlBox)? Everything I've tried seems to produce unsatisfactory
results. A picture box doesn't give me the icon size I want. I've been
using a PictureBox, hooking its Paint event and doing it manually. Is
there a better way?


Thanks,
Jacob
 
Jacob,

That's pretty much about it. I'm curious though, what are the results
that you are getting with the picturebox which are unsatisfactory?

Other than that, I would make sure to refactor the code out into another
user control so that you can easily reuse the code.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Jacob said:
Ya, as I mentioned.... that's what I've been doing. Anything else?

Thanks,
Jacob




Nicholas Paldino said:
Jacob,

If the picture box doesn't give you what you want, have you considered
painting the icons yourself?

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Jacob said:
What's the best way to put an Icon in the client area of a form (not in
the ControlBox)? Everything I've tried seems to produce unsatisfactory
results. A picture box doesn't give me the icon size I want. I've been
using a PictureBox, hooking its Paint event and doing it manually. Is
there a better way?


Thanks,
Jacob
 
What I was referencing when I said unsatisfactory results is when the icon
returns the incorrect size. The Icon class is supposed to automatically
choose the best icon size and bit-depth. Sometimes it doesn't. There is an
Icon constructor to request an icon of a certain size, but no method to know
which sizes there are.

Most of the time, if you create an Icon it will be the 32x32 copy which is
the system default in most cases. It just seems that there is no simple
approach.

Jacob


Nicholas Paldino said:
Jacob,

That's pretty much about it. I'm curious though, what are the results
that you are getting with the picturebox which are unsatisfactory?

Other than that, I would make sure to refactor the code out into
another user control so that you can easily reuse the code.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Jacob said:
Ya, as I mentioned.... that's what I've been doing. Anything else?

Thanks,
Jacob




Nicholas Paldino said:
Jacob,

If the picture box doesn't give you what you want, have you
considered painting the icons yourself?

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

What's the best way to put an Icon in the client area of a form (not in
the ControlBox)? Everything I've tried seems to produce unsatisfactory
results. A picture box doesn't give me the icon size I want. I've been
using a PictureBox, hooking its Paint event and doing it manually. Is
there a better way?


Thanks,
Jacob
 
Back
Top