Link to home
Create AccountLog in
Avatar of altariamx2003
altariamx2003Flag for Mexico

asked on

how to hide maximize button from ribbon control of dotnetbar library for Visual Basic .NET

I would like to know if somebody know how to hide just the "maximize button" from the ribbon control of the dotnetbar library for visual basic .net???

I found this code on google, but this code hide all buttons in the tittle bar
Dim sysItems As ArrayList = ribbonControl1.RibbonStrip.GetItems("", GetType(SystemCaptionItem))
Dim item As SystemCaptionItem
 
For Each item In sysItems
   If Not item.IsSystemIcon Then
      item.Visible = False
   End If
Next

Open in new window

Avatar of larkvale
larkvale
Flag of United Kingdom of Great Britain and Northern Ireland image


In the form which contains the ribbon control set the MaximizeBox property to False
Avatar of altariamx2003

ASKER

I do that but, that only disabled the maximize button of the form, not the maximize button created by the ribbon control of the dotnetbar library
The maximize button that i need to hide is the button created with the "ribbon control" of the dotnetbar library
Avatar of Nasir Razzaq
Within this check

If Not item.IsSystemIcon Then

add another check but you would have to do some exploration to determine whether the current item is a maximize button. So for example (just a demo not sure if it would work)

For Each item In sysItems
   If Not item.IsSystemIcon Then
      If item.Name = "Maximize" Then
         item.Visible = False
         Exit For
      End If
   End If
Next
I dont know which item is the maximize button, my boss bought this library for me.

And I dont know anything about this library

Does the intellisense not show the properties of the Item?
this are the properties of item

User generated image
User generated image
 User generated image
 User generated image
 User generated image
 User generated image
 User generated image
Hmm Nice. Try adding a msgbox to show the Text and Name of each item and see if what's the text/name of the maximize button and then use that in the if condition.
item.name and item.text shows empity values
I am not sure what you mean by the Maximize button on the Ribbon control.

1. Do you mean the "Maximze / Minimize the Ribbon" or do you mean the button that maximizes the whole form, ?

2. Can you send a screen shot and point out which button you want to hide ?

3. What class is your form derived from ? it shouild be
                                 Inherits DevComponents.DotNetBar.Office2007Form




Also try the ID and Command properties.
ASKER CERTIFIED SOLUTION
Avatar of altariamx2003
altariamx2003
Flag of Mexico image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Im gonna try with the supliers of the library