Click here to Skip to main content
15,881,248 members
Home / Discussions / C#
   

C#

 
GeneralRe: .NET runtime environments Pin
Furty2-Feb-03 10:01
Furty2-Feb-03 10:01 
GeneralRe: .NET runtime environments Pin
Stephane Rodriguez.2-Feb-03 10:07
Stephane Rodriguez.2-Feb-03 10:07 
GeneralRe: .NET runtime environments Pin
Anonymous2-Feb-03 12:27
Anonymous2-Feb-03 12:27 
GeneralRe: .NET runtime environments Pin
ian mariano3-Feb-03 12:37
ian mariano3-Feb-03 12:37 
QuestionDetecting true or open or other type a font is? Pin
Member 1490692-Feb-03 7:23
Member 1490692-Feb-03 7:23 
QuestionAdding Controls to MenuItems? Pin
Jon Newman2-Feb-03 7:01
Jon Newman2-Feb-03 7:01 
AnswerRe: Adding Controls to MenuItems? Pin
Furty2-Feb-03 10:11
Furty2-Feb-03 10:11 
GeneralRe: Adding Controls to MenuItems? Pin
Jon Newman2-Feb-03 10:56
Jon Newman2-Feb-03 10:56 
The MenuItem Class has no Bounds property. The only thing I can think of is the OnDrawItem() override. I've used this to draw stuff to the menuitem. HOwever setting the control to use the System.Windows.Forms.DrawItemEventArgs.Bounds property doesn't seem to cut it.


C++
<br />
public class ControlMenu : System.Windows.Forms.MenuItem<br />
{<br />
<br />
public TrackBar track;<br />
<br />
<br />
public ControlMenu()<br />
{<br />
<br />
   track = new TrackBar();<br />
   this.track.Name = "trackBar1";<br />
<br />
   this.track.Orientation = System.Windows.Forms.Orientation.Vertical;<br />
   this.track.Size = new System.Drawing.Size(42, 144);<br />
   this.track.TabIndex = 13;<br />
   this.track.Value = 10;	<br />
<br />
}	<br />
protected override void OnDrawItem(System.Windows.Forms.DrawItemEventArgs e)<br />
{<br />
   base.OnDrawItem(e);<br />
<br />
   track.Bounds = e.Bounds;<br />
   track.Visible = true;<br />
   track.BringToFront();<br />
   track.Focus();<br />
}<br />

I've tried having base.OnDrawItem(e); before and after the bounds setting code, without any luck.

Any Ideas?



"Where would you rather be today?"
 


GeneralRe: Adding Controls to MenuItems? Pin
Furty2-Feb-03 11:54
Furty2-Feb-03 11:54 
GeneralRe: Adding Controls to MenuItems? Pin
Jon Newman2-Feb-03 12:11
Jon Newman2-Feb-03 12:11 
GeneralRe: Adding Controls to MenuItems? Pin
Furty2-Feb-03 12:43
Furty2-Feb-03 12:43 
GeneralRe: Adding Controls to MenuItems? Pin
jtmtv182-Feb-03 14:36
jtmtv182-Feb-03 14:36 
GeneralSending Mail in C# Pin
Sassan Komeili Zadeh1-Feb-03 20:44
Sassan Komeili Zadeh1-Feb-03 20:44 
GeneralRe: Sending Mail in C# Pin
Vasudevan Deepak Kumar1-Feb-03 21:31
Vasudevan Deepak Kumar1-Feb-03 21:31 
GeneralRe: Sending Mail in C# Pin
leppie1-Feb-03 22:02
leppie1-Feb-03 22:02 
GeneralRe: Sending Mail in C# Pin
leppie1-Feb-03 22:10
leppie1-Feb-03 22:10 
GeneralRe: Sending Mail in C# Pin
Sassan Komeili Zadeh3-Feb-03 6:42
Sassan Komeili Zadeh3-Feb-03 6:42 
GeneralRe: Sending Mail in C# Pin
John Mautari11-Feb-03 5:36
John Mautari11-Feb-03 5:36 
QuestionComponents for spell checker and PDF generation ? Pin
Smitha Nishant1-Feb-03 17:36
protectorSmitha Nishant1-Feb-03 17:36 
AnswerRe: Components for spell checker and PDF generation ? Pin
jtmtv181-Feb-03 17:45
jtmtv181-Feb-03 17:45 
AnswerRe: Components for spell checker and PDF generation ? Pin
Vasudevan Deepak Kumar1-Feb-03 18:11
Vasudevan Deepak Kumar1-Feb-03 18:11 
GeneralFile Splitter Pin
Jassim Rahma1-Feb-03 17:32
Jassim Rahma1-Feb-03 17:32 
GeneralRe: File Splitter Pin
Vasudevan Deepak Kumar1-Feb-03 21:46
Vasudevan Deepak Kumar1-Feb-03 21:46 
Generalcoding styles Pin
jtmtv181-Feb-03 14:21
jtmtv181-Feb-03 14:21 
GeneralRe: coding styles Pin
Chris Austin1-Feb-03 16:02
Chris Austin1-Feb-03 16:02 

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.