憔 憔悴 Unregistered / Unconfirmed GUEST, unregistred user! 2002-03-27 #1 就象Windows的开始菜单一样,左边有一个竖着的图片条.右边是菜单项.如何实现之!请指点!
S shangshang Unregistered / Unconfirmed GUEST, unregistred user! 2002-03-27 #2 去找控件拉,到处都是这样的,<br><br>你若是心情好,时间多的话,自己画吧。
J jrq Unregistered / Unconfirmed GUEST, unregistred user! 2002-03-27 #3 转贴(1)<br>------------------<br>菜单项中增加一条空项,在第一行,其bitmap属性中制定你要的位图.<br>菜单的owner draw:=true,<br>在OnMeasureItem中设定菜单长宽,在ownerdraw中画位图<br>procedure TForm1.n1measureitem(....)<br>begin<br> width:=n1.bitmap.width;<br> height:=n1.bitmap.height;<br>end;<br><br>procedure TForm1.n1DrawItem(Sender:Tobject;Acanvas::TCanvas;ARect:<br>TRect;Selected::Boolean)<br>begin<br> ACanvas.draw(ARect.left,ARect.top,n1.bitmap);<br>end;<br>-----------------------<br>转贴(2)<br>首先自己做一副图,在上面写上自己要在菜单上显示的东东,然后用Delphi制作菜单,<br>然后参照下面的代码就行了.<br><br>procedure TfrmMain.mnuShowMainMeasureItem(Sender: TObject;<br> ACanvas: TCanvas; var Width, Height: Integer);<br>begin<br> Height:=18;<br> Width:=140;<br> ACanvas.Brush.Color:=clBlue;<br> ACanvas.TextOut(0,10,TMenuitem(Sender).Caption);<br>end;<br><br>procedure TfrmMain.mnuShowMainDrawItem(Sender: TObject; ACanvas: TCanvas;<br> ARect: TRect; Selected: Boolean);<br>begin<br> acanvas.Draw(0,0,image1.picture.bitmap);<br> acanvas.TextOut(arect.left+image1.picture.bitmap.width+12,arect.top,tmenuitem(sender).caption);<br>end;<br>--------------------<br>这是数据库中的资料 []<br><br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=467811
转贴(1)<br>------------------<br>菜单项中增加一条空项,在第一行,其bitmap属性中制定你要的位图.<br>菜单的owner draw:=true,<br>在OnMeasureItem中设定菜单长宽,在ownerdraw中画位图<br>procedure TForm1.n1measureitem(....)<br>begin<br> width:=n1.bitmap.width;<br> height:=n1.bitmap.height;<br>end;<br><br>procedure TForm1.n1DrawItem(Sender:Tobject;Acanvas::TCanvas;ARect:<br>TRect;Selected::Boolean)<br>begin<br> ACanvas.draw(ARect.left,ARect.top,n1.bitmap);<br>end;<br>-----------------------<br>转贴(2)<br>首先自己做一副图,在上面写上自己要在菜单上显示的东东,然后用Delphi制作菜单,<br>然后参照下面的代码就行了.<br><br>procedure TfrmMain.mnuShowMainMeasureItem(Sender: TObject;<br> ACanvas: TCanvas; var Width, Height: Integer);<br>begin<br> Height:=18;<br> Width:=140;<br> ACanvas.Brush.Color:=clBlue;<br> ACanvas.TextOut(0,10,TMenuitem(Sender).Caption);<br>end;<br><br>procedure TfrmMain.mnuShowMainDrawItem(Sender: TObject; ACanvas: TCanvas;<br> ARect: TRect; Selected: Boolean);<br>begin<br> acanvas.Draw(0,0,image1.picture.bitmap);<br> acanvas.TextOut(arect.left+image1.picture.bitmap.width+12,arect.top,tmenuitem(sender).caption);<br>end;<br>--------------------<br>这是数据库中的资料 []<br><br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=467811
悲 悲酥清风 Unregistered / Unconfirmed GUEST, unregistred user! 2002-03-27 #4 DevExpress Bar的菜单控件做出来的效果不错,就是耗资源多一点。
憔 憔悴 Unregistered / Unconfirmed GUEST, unregistred user! 2002-03-28 #5 有一个问题:<br>自己画菜单倒是可以,但是如果把右边菜单里的某一个MenuItem变成一个Separator('-')<br>那么这个 横杆 将贯穿到左边的 Bar 区域,这个怎么解决呢??
晶 晶晶 Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-24 #6 你自己修改啊,我有代码,要就找我tufeiping@sina.com记得发分