Click here to Skip to main content
15,892,697 members
Home / Discussions / C#
   

C#

 
GeneralRe: Listing files&folders on a server Pin
Mazdak20-Feb-04 2:15
Mazdak20-Feb-04 2:15 
GeneralRe: Listing files&folders on a server Pin
CWIZO20-Feb-04 3:33
CWIZO20-Feb-04 3:33 
GeneralRe: Listing files&folders on a server Pin
Mazdak20-Feb-04 3:45
Mazdak20-Feb-04 3:45 
GeneralRe: Listing files&folders on a server Pin
CWIZO20-Feb-04 9:58
CWIZO20-Feb-04 9:58 
GeneralOwner drawn Menu Items Pin
Katalin20-Feb-04 0:20
Katalin20-Feb-04 0:20 
GeneralRe: Owner drawn Menu Items Pin
Heath Stewart20-Feb-04 3:30
protectorHeath Stewart20-Feb-04 3:30 
GeneralRe: Owner drawn Menu Items Pin
Katalin20-Feb-04 4:28
Katalin20-Feb-04 4:28 
GeneralRe: Owner drawn Menu Items Pin
Heath Stewart20-Feb-04 6:14
protectorHeath Stewart20-Feb-04 6:14 
The MenuItem.DrawItem event gives you the the Graphics object you should be using. It's possible the out-of-memory exception is because a Graphics object has already been created from the window handle, which obtained the HDC internally. There can only exist one HDC for the drawing operation, IIRC.

I threw together a quick test and see what you mean. Unfortunately, .NET probably has nothing to do with this since it merely encapsulates the Windows APIs. You could always try adjusting the SizeF in which the text is drawn so that the menu item is long enough to display some space between the arrow and the text. I have heard that there are some quirks in right-to-left reading orders, and this appears to be one. Googling for this subject pretty much comes up with that idea - offsetting your text appropriately.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Owner drawn Menu Items Pin
Katalin22-Feb-04 21:47
Katalin22-Feb-04 21:47 
GeneralRe: Owner drawn Menu Items Pin
Heath Stewart23-Feb-04 3:32
protectorHeath Stewart23-Feb-04 3:32 
GeneralRe: Owner drawn Menu Items Pin
Katalin23-Feb-04 3:51
Katalin23-Feb-04 3:51 
GeneralRe: Owner drawn Menu Items Pin
Heath Stewart23-Feb-04 3:56
protectorHeath Stewart23-Feb-04 3:56 
GeneralRe: Owner drawn Menu Items Pin
Katalin23-Feb-04 22:07
Katalin23-Feb-04 22:07 
GeneralCOM Problem - StrRetToStr() Pin
Tristan Rhodes20-Feb-04 0:14
Tristan Rhodes20-Feb-04 0:14 
Generalrun command Pin
Rob Tomson20-Feb-04 0:01
Rob Tomson20-Feb-04 0:01 
GeneralRe: run command Pin
Mazdak20-Feb-04 0:54
Mazdak20-Feb-04 0:54 
GeneralRe: run command Pin
Jaclyn20-Feb-04 1:00
Jaclyn20-Feb-04 1:00 
GeneralRe: run command Pin
Rob Tomson20-Feb-04 5:29
Rob Tomson20-Feb-04 5:29 
GeneralScrollableControl Pin
PaulStat19-Feb-04 23:36
PaulStat19-Feb-04 23:36 
GeneralRe: ScrollableControl Pin
Werdna20-Feb-04 3:33
Werdna20-Feb-04 3:33 
GeneralRe: ScrollableControl Pin
Heath Stewart20-Feb-04 3:42
protectorHeath Stewart20-Feb-04 3:42 
GeneralRaise an Scrollevent Pin
Fleischen19-Feb-04 23:21
Fleischen19-Feb-04 23:21 
GeneralRe: Raise an Scrollevent Pin
Mazdak20-Feb-04 0:57
Mazdak20-Feb-04 0:57 
GeneralAdd checkbox to BrowseForFolder Pin
Rob Tomson19-Feb-04 21:14
Rob Tomson19-Feb-04 21:14 
GeneralAccessing taskbar apps Pin
Jaclyn19-Feb-04 21:12
Jaclyn19-Feb-04 21:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.