Notifications
Clear all

[Closed] About:DevExpress –RibbonControl

Hi, all.

I’m test the DevExpress.XtraBars.Ribbon.RibbonForm , looks very cool. but, I dont know how can add picture button on the bar.

can anybody help me have a look my code. thank you very much…

Joe

PS: you need load DevExpress.XtraBars.v7.1.dll

Link : http://www.afeel3d.com/DevExpress.XtraBars.v7.1.rar


 
DotNet.LoadAssembly  @"c:\DevExpress.XtraBars.v7.1.dll" 
fn test =
 (
 /*HForm*/
 hForm = dotNetObject "DevExpress.XtraBars.Ribbon.RibbonForm"
 hForm.Size = dotNetObject "System.Drawing.Size" 400 300
 hForm.Text= "test-1"
 hForm.FormBorderStyle = (dotnetclass "System.Windows.Forms.FormBorderStyle").Sizable
 hForm.ShowInTaskbar = true

  /*ribbon_control*/
  RBcontrol=dotNetObject"DevExpress.XtraBars.Ribbon.RibbonControl"
  RBcontrol.Name = "ribbon" 
  
  /*frist page*/
  RBPage1 =dotNetObject"DevExpress.XtraBars.Ribbon.RibbonPage"  
  RBPage1.text="page1"
  
  /*frist group*/  
  BBI_picbutton = dotNetObject"DevExpress.XtraBars.BarbuttonItem"
  BBI_picbutton.caption ="picture_button"
  
  /*here I'm try load imagelist*/
  
  components =dotnetobject "System.ComponentModel.Container"
  imageCollection1 =dotnetobject "DevExpress.Utils.ImageCollection"(components)
  RBcontrol.Images =imageCollection1
  
  /*show it*/
  BBI_picbutton.ImageIndex =1
  RBgroup1=dotNetObject"DevExpress.XtraBars.Ribbon.Ribbonpagegroup"
  RBgroup1.text ="group1"
  RBgroup1.ItemLinks.AddRange #(BBI_picbutton)
  /*other add data*/
  RBcontrol.Items.AddRange #(BBI_picbutton)
  RBcontrol.pages.AddRange #(RBPage1)
  RBPage1.Groups.AddRange #(RBgroup1)
  
  Hform.controls.add(RBcontrol)
  hForm.Show()
 )
 test ()

 
 

2 Replies

Was just interested in the control… if you want just an image button, perhaps you need a different button class…

else I found this… puts an image next to your text string.


 tnImage = ((dotNetclass "System.Drawing.Bitmap").fromFile( getDir #maxRoot +"ui\\icons\\Splines_24i.bmp"))
 BBI_picbutton.Glyph = tnImage
 

This makes a big button, don’t know if it’s the right way to utilize this control however…


 tnImage = ((dotNetclass "System.Drawing.Bitmap").fromFile( getDir #maxRoot +"ui\\icons\\Splines_24i.bmp"))
 BBI_picbutton.LargeGlyph = tnImage
 

Good luck

1 Reply
(@bingheyuren)
Joined: 11 months ago

Posts: 0

Hi,Keith R Morrison. this is a good way to add picture for the button, and also can custom button picture by myself. thank you very much…