Peter Kiers
asked on
Force persistent underscores in MainMenu, like Word has.
Hi,
I have received from my previous question an url about how to force
underscores in the MainMenu. This is the link:
http://www.tek-tips.com/viewthread.cfm?qid=1489404&page=22
I have read it, and came to the conclussion that I have set this procedure below to every menu-item I got!!!
procedure TMainForm.AdvancedDrawItem (Sender: TObject; ACanvas: TCanvas; ARect: TRect; State: TOwnerDrawState);
begin
if odnoAccel in State then // this proc to force underscore on menu items
State := State - [odnoAccel];
TMenuItem(Sender).OnAdvanc edDrawItem := nil;
DrawMenuItem(TMenuItem(Sen der), ACanvas, ARect, State);
TMenuItem(Sender).OnAdvanc edDrawItem := AdvancedDrawItem;
end;
So I have 20 menu-items, so I have to add 20 times AdvancedDrawItem-procedure .
Isn't there a better way?
Peter
I have received from my previous question an url about how to force
underscores in the MainMenu. This is the link:
http://www.tek-tips.com/viewthread.cfm?qid=1489404&page=22
I have read it, and came to the conclussion that I have set this procedure below to every menu-item I got!!!
procedure TMainForm.AdvancedDrawItem
begin
if odnoAccel in State then // this proc to force underscore on menu items
State := State - [odnoAccel];
TMenuItem(Sender).OnAdvanc
DrawMenuItem(TMenuItem(Sen
TMenuItem(Sender).OnAdvanc
end;
So I have 20 menu-items, so I have to add 20 times AdvancedDrawItem-procedure
Isn't there a better way?
Peter
mmm, if you could replace your TMainmenu with a TJvMainMenu you shoul solve it without using any AdvancedDrawItem procedure, as TJvMainMenu already shows shortcuts directly without pressing any alt key (using of course the '&' in the caption)
ASKER
Ok, where can I find this component?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thnx, Peter Kiers.
500 points are comming to you...
500 points are comming to you...