CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2000
    Location
    Bangalore,India
    Posts
    776

    Changing the size of top level menu items

    I tried to increment the size of menu items using the owner draw but could make it for submenus not the top level menu items. Can any one tell me whether its possible to resize the top-level menu items or not?
    If yes, pls give some sample code or hints to do that.

    Thanks and regards
    skpradhan

  2. #2
    Join Date
    Nov 2002
    Location
    Singapore
    Posts
    1,890
    implement owner draw.
    determine the size of font and etc.

    here is the snippet ( using simple routine )

    e.DrawFocusRectangle();
    Graphics g = e.Graphics;

    float x= 10;
    if ( e.Index == 0 )
    x = 10 ;
    else if ( e.Index == 1 )
    x = 30;

    g.DrawString(mainMenu1.MenuItems[e.Index].Text, this.Font, Brushes.Red, x, 25) ;

    something like that.

    Paresh.
    - Software Architect

  3. #3
    Join Date
    Mar 2000
    Location
    Bangalore,India
    Posts
    776
    Hi Paresh
    Thanks for the reply. Still I am not able t change the size of top level menu items like File,Edit etc.
    Can you please help me on that? Is it possible to resize the top level items?
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured