PC Review


Reply
Thread Tools Rate Thread

Determine bounds of ImageMargin

 
 
=?Utf-8?B?bGpsZXZlbmQy?=
Guest
Posts: n/a
 
      7th Feb 2007
Is there any way to determine the bounds (or at least the width) of the image
margin region of a Windows.Forms.ToolStripDropDownMenu? I know that the
bounds are specified in
Windows.Forms.ToolStripProfessionalRenderer.OnRenderImageMargin via the
Windows.Forms.ToolStripRenderEventArgs.AffectedBounds property. But, there
are other times when the width of the image margin is required, such as when
drawing images or checks within the region (especially when ShowCheckMargin
and ShowImageMargin are both true) or when custom drawing separators.

Thanks for any help!
Lance

 
Reply With Quote
 
 
 
 
Linda Liu [MSFT]
Guest
Posts: n/a
 
      8th Feb 2007
Hi Lance,

This is a quick note to let you know that I am performing research on this
issue and will get the result back to you ASAP.

I appreciate your patience!


Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
Linda Liu [MSFT]
Guest
Posts: n/a
 
      9th Feb 2007
Hi Lance,

I have spent several hours researching on this problem but unfortunately, I
haven't found a way to get the bounds of image&check margin of a
ToolStripDropDownMenu except the way of getting it in the override
OnRenderImageMargin method in the derived ToolStripRenderer class.

In additon, in the override OnRenderImageMargin method in the derived
ToolStripRenderer class, the AffectedBounds property of
ToolStripRenderEventArgs parameter returns the bound covering both the
check and image margin, if they all exist.

Actually, when the ImageScaling property of a ToolStripItem is set to
SizeToFit, which is the default value, the image of the ToolStripItem will
be resized to fit the image margin. We needn't worry that the width of our
image may not fit the image margin.

Hope this helps.
If you have any concerns, please feel free to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support

 
Reply With Quote
 
=?Utf-8?B?bGpsZXZlbmQy?=
Guest
Posts: n/a
 
      9th Feb 2007
Hi Linda,

Thank you for looking into this. Just knowing that there isn't a direct way
to determine the width of the ImageMargin is very helpful. I'm sure that I
will be able to implement a workaround without too much difficulty.

Thanks again. You're always a big help!
Lance

 
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
bounds Bill McCarthy Microsoft VB .NET 0 29th Sep 2009 01:51 PM
Array bounds Bill Microsoft Access Form Coding 5 29th Jul 2006 09:17 PM
Is there a method to determine if the mouse position is inside the bounds of a treeview node? **Developer** Microsoft VB .NET 3 14th Feb 2006 05:44 PM
Windows bounds Jacobo Rodriguez Microsoft Dot NET Framework Forms 3 16th Mar 2004 06:02 PM
Index out of bounds? BUB 209 Anti-Virus 3 20th Jan 2004 05:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:44 PM.