Hi.
I'm using the ButtonTool in XamRibbon. I'd like to have some button with larger appearance than others. For this I've tried to increase the buttons height but found out the buttons image and content do not increase respectively. Is there a way in which I'd be able to increase my icons?
Thanks,
Izhar Lotem
Just as with Office, the images of the tools are either small (16x16 in our default templates) or large (32x32) in our default templates. A ButtonTool on a RibbonGroup will use the small image whenever its SizingMode is ImageOnly or ImageAndTextNormal and will use the large image size when its SizingMode is ImageAndTextLarge. By default the attached property RibbonGroup.MaximumSize is ImageAndTextNormal for a ButtonTool. If you want it to be large you can set this property to ImageAndTextLarge. If you don't want the resizing logic to reduce the size of the tool when there isn't enough room you would set the RibbonGroup.MinimumSize attached property to ImageAndTextLarge. If you want to use sizes other than our defaults then you would need to retemplate the elements. You can use the default styles we ship with the product (located in the DefaultStyles directory) as the starting point for your custom templates.
Hi, I am creating ButtonTool dynamically and I've set RibbonToolSizingMode to ImageAndTextLarg, but still is the image inside Button small. Pl, need solution. thanx
RibbonTabItem rti = new RibbonTabItem(); rti.Name = bri.ribTab; rti.Header = bri.ribTabName; rti.Height = 20; rti.FontSize = 10; rti.RibbonGroups.Clear(); RibbonGroup = new RibbonGroup(); rg.Id = bri.ribSection; rg.Caption = bri.ribSectionName; RibbonGroup.SetMaximumSize(rg, RibbonToolSizingMode.ImageAndTextLarge); ToolHorizontalWrapPanel thwp = new ToolHorizontalWrapPanel(); thwp.MinRows = 3; rg.Items.Add(thwp); ButtonTool btn; foreach (BasicRibbonItem bi in polozky) { btn = new ButtonTool(); btn.Name = "btn" + bi.Name; btn.LargeImage = new BitmapImage(new Uri(bi.Image, UriKind.Relative)); btn.Caption = "Example"; thwp.Children.Add(btn); } rti.RibbonGroups.Add(rg); ribbon.Tabs.Add(rti);
If I set igRibbon:RibbonGroup.MinimumSize="ImageAndTextLarge" I should always get the large image correct? It seems I am doing something wrong. This I have an image that is 48x48 but its not resizing the buttontool.
<igRibbon:ButtonGroup MinHeight="48" MinWidth="48"> <igRibbon:ButtonTool igRibbon:RibbonGroup.MinimumSize="ImageAndTextLarge"> </igRibbon:ButtonTool> </igRibbon:ButtonGroup> If I take it out of the ButtonGroup, it still doesnt enlarge the image. I know its only 32x32, but it shouldnt matter what size I have coming into the button, as long as its MinSize is set (from what I read here) In code I have this to add the image Dim myPointer As System.IntPtr Dim mySizeOptions As System.Windows.Media.Imaging.BitmapSizeOptions = System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions() myPointer = DirectCast(Me.m_cMyWinManager.MyWinHelper.GetResourceImage(cMyWinHelper.MyResourceImage.PNG48_RedoV2), System.Drawing.Bitmap).GetHbitmap() Me.ToolBtnRedo.LargeImage = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(myPointer, IntPtr.Zero, Int32Rect.Empty, mySizeOptions) Please advise... Thanks SDI
<igRibbon:ButtonGroup MinHeight="48" MinWidth="48">
<igRibbon:ButtonTool igRibbon:RibbonGroup.MinimumSize="ImageAndTextLarge"> </igRibbon:ButtonTool> </igRibbon:ButtonGroup> If I take it out of the ButtonGroup, it still doesnt enlarge the image. I know its only 32x32, but it shouldnt matter what size I have coming into the button, as long as its MinSize is set (from what I read here) In code I have this to add the image Dim myPointer As System.IntPtr Dim mySizeOptions As System.Windows.Media.Imaging.BitmapSizeOptions = System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions() myPointer = DirectCast(Me.m_cMyWinManager.MyWinHelper.GetResourceImage(cMyWinHelper.MyResourceImage.PNG48_RedoV2), System.Drawing.Bitmap).GetHbitmap() Me.ToolBtnRedo.LargeImage = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(myPointer, IntPtr.Zero, Int32Rect.Empty, mySizeOptions) Please advise... Thanks SDI
<igRibbon:ButtonTool igRibbon:RibbonGroup.MinimumSize="ImageAndTextLarge">
</igRibbon:ButtonTool> </igRibbon:ButtonGroup> If I take it out of the ButtonGroup, it still doesnt enlarge the image. I know its only 32x32, but it shouldnt matter what size I have coming into the button, as long as its MinSize is set (from what I read here) In code I have this to add the image Dim myPointer As System.IntPtr Dim mySizeOptions As System.Windows.Media.Imaging.BitmapSizeOptions = System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions() myPointer = DirectCast(Me.m_cMyWinManager.MyWinHelper.GetResourceImage(cMyWinHelper.MyResourceImage.PNG48_RedoV2), System.Drawing.Bitmap).GetHbitmap() Me.ToolBtnRedo.LargeImage = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(myPointer, IntPtr.Zero, Int32Rect.Empty, mySizeOptions) Please advise... Thanks SDI
</igRibbon:ButtonTool>
</igRibbon:ButtonGroup>
If I take it out of the ButtonGroup, it still doesnt enlarge the image. I know its only 32x32, but it shouldnt matter
what size I have coming into the button, as long as its MinSize is set (from what I read here)
In code I have this to add the image
Dim myPointer As System.IntPtr Dim mySizeOptions As System.Windows.Media.Imaging.BitmapSizeOptions = System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions()
Dim myPointer As System.IntPtr
Dim mySizeOptions As System.Windows.Media.Imaging.BitmapSizeOptions = System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions()
myPointer = DirectCast(Me.m_cMyWinManager.MyWinHelper.GetResourceImage(cMyWinHelper.MyResourceImage.PNG48_RedoV2), System.Drawing.Bitmap).GetHbitmap()
Me.ToolBtnRedo.LargeImage = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(myPointer, IntPtr.Zero, Int32Rect.Empty, mySizeOptions) Please advise... Thanks SDI
Me.ToolBtnRedo.LargeImage = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(myPointer, IntPtr.Zero, Int32Rect.Empty, mySizeOptions)
Please advise...
Thanks
SDI