473,465 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Determine bounds of ImageMargin

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.OnRend erImageMargin via the
Windows.Forms.ToolStripRenderEventArgs.AffectedBou nds 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

Feb 7 '07 #1
3 1004
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.

Feb 8 '07 #2
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

Feb 9 '07 #3
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

Feb 9 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

50
by: jacob navia | last post by:
As everybody knows, the C language lacks a way of specifying bounds checked arrays. This situation is intolerable for people that know that errors are easy to do, and putting today's powerful...
31
by: bilbothebagginsbab5 AT freenet DOT de | last post by:
Hello, hello. So. I've read what I could find on google(groups) for this, also the faq of comp.lang.c. But still I do not understand why there is not standard method to "(...) query the...
3
by: **Developer** | last post by:
I need to know when the mouse is over the text of a TreeView node. I know how to get the Bounds of the node which appear to be the correct values to delineate the text. I could check the mouse...
0
by: Smokey Grindle | last post by:
This is just a wierd one... I am trying to draw the sub items in the drawitem event of the list view in owner drawn mode (because of documented W32 rendering bugs) instead of in two seperate items...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.