Click here to Skip to main content
15,900,378 members
Home / Discussions / C#
   

C#

 
GeneralXML in c# multi Elements Pin
Dwayner794-Feb-05 8:20
Dwayner794-Feb-05 8:20 
GeneralRe: XML in c# multi Elements Pin
Heath Stewart4-Feb-05 8:56
protectorHeath Stewart4-Feb-05 8:56 
GeneralRe: XML in c# multi Elements Pin
Dwayner794-Feb-05 9:53
Dwayner794-Feb-05 9:53 
GeneralRe: XML in c# multi Elements Pin
Heath Stewart4-Feb-05 12:57
protectorHeath Stewart4-Feb-05 12:57 
QuestionListbox problem solved! But WHY?? Pin
chrismarek4-Feb-05 8:18
chrismarek4-Feb-05 8:18 
Generaladding attachments to an email Pin
Aviv Halperin4-Feb-05 6:05
Aviv Halperin4-Feb-05 6:05 
GeneralRe: adding attachments to an email Pin
Heath Stewart4-Feb-05 6:31
protectorHeath Stewart4-Feb-05 6:31 
QuestionHow to have MenuItems not show arrow when it has submenu Pin
VPMahank4-Feb-05 5:28
VPMahank4-Feb-05 5:28 
Hai all,

Somebody help me in this issue. I need to have a menu bar which is
RightToLeft aligned, which I can achieve by setting MainMenu's RightToLeft
property to "Yes". The problem that I get is, if one of MenuItems has
submenu...the arrow(or small triangle which indiates it has submenu) appears
in the left. I wanted to know when is this getting drawn. I want to trap
that and draw my own image to indicate that it has submenu. Below is the
code that I have written for DrawItem and MeasureItem for each MenuItem. Any
help is greatly appreciated.....

Thanks,

Madhavi.




private void menuItem1_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)

{

Rectangle rc = new Rectangle(e.Bounds.X+1 , e.Bounds.Y+1, e.Bounds.Width,
e.Bounds.Height-1);

e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(51,102,153)), rc);

MenuItem s = (MenuItem)sender ;

RedrawSubMenuItems(s);

string s1 = s.Text +" |" ;

StringFormat sf = new StringFormat();

sf.Alignment = StringAlignment.Near ;

e.Graphics.DrawString(s1 , new Font("Ariel" ,9, FontStyle.Bold), new
SolidBrush(Color.FromArgb(255,255,128)) , rc , sf );

Console.WriteLine(e.State.ToString());

if ( e.State == (DrawItemState.NoAccelerator | DrawItemState.Selected) ||

e.State == ( DrawItemState.NoAccelerator | DrawItemState.HotLight) )

{

//e.Graphics.FillRectangle(new SolidBrush(Color.LightYellow) , rc);

e.Graphics.DrawString( s.Text , new Font("Ariel" , 9 , FontStyle.Bold |
FontStyle.Underline ) , new SolidBrush(Color.FromArgb(255,255,128)), rc
,sf);

//e.Graphics.DrawRectangle(new Pen(new SolidBrush(Color.Black)), rc );

}

GeneralSocket and Multithreading Pin
sameerhanda4-Feb-05 5:05
sameerhanda4-Feb-05 5:05 
GeneralRe: Socket and Multithreading Pin
Heath Stewart4-Feb-05 6:24
protectorHeath Stewart4-Feb-05 6:24 
GeneralFilestream issue Pin
Esmo20004-Feb-05 4:43
Esmo20004-Feb-05 4:43 
GeneralRe: Filestream issue Pin
Esmo20004-Feb-05 4:46
Esmo20004-Feb-05 4:46 
GeneralRe: Filestream issue Pin
Anonymous4-Feb-05 4:57
Anonymous4-Feb-05 4:57 
GeneralRe: Filestream issue Pin
Heath Stewart4-Feb-05 6:20
protectorHeath Stewart4-Feb-05 6:20 
GeneralBeep() without using Windows.Forms Pin
Tim Gilbert4-Feb-05 4:32
Tim Gilbert4-Feb-05 4:32 
GeneralRe: Beep() without using Windows.Forms Pin
Anonymous4-Feb-05 4:39
Anonymous4-Feb-05 4:39 
GeneralRe: Beep() without using Windows.Forms Pin
Tim Gilbert4-Feb-05 4:48
Tim Gilbert4-Feb-05 4:48 
GeneralRe: Beep() without using Windows.Forms Pin
Dave Kreskowiak4-Feb-05 6:33
mveDave Kreskowiak4-Feb-05 6:33 
GeneralRe: Beep() without using Windows.Forms Pin
Nick Parker4-Feb-05 6:13
protectorNick Parker4-Feb-05 6:13 
GeneralRe: Beep() without using Windows.Forms Pin
Heath Stewart4-Feb-05 6:16
protectorHeath Stewart4-Feb-05 6:16 
GeneralRe: Beep() without using Windows.Forms Pin
Dave Kreskowiak4-Feb-05 6:35
mveDave Kreskowiak4-Feb-05 6:35 
GeneralLinkLabel size Pin
gantww4-Feb-05 3:39
gantww4-Feb-05 3:39 
GeneralRe: LinkLabel size Pin
Anonymous4-Feb-05 4:45
Anonymous4-Feb-05 4:45 
GeneralRe: LinkLabel size Pin
gantww4-Feb-05 7:54
gantww4-Feb-05 7:54 
GeneralImage Rectify or Panorama algorithm Pin
pxp4-Feb-05 3:15
pxp4-Feb-05 3:15 

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.