Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Ribbon Tech Support » Cannot Create DropDown + Separator with Text > Error? Collapse All
Subject Author Date
Gunter Avenius Jun 2, 2008 - 1:13 AM

Hello,


I create a Dropdown and a Separator with Code (vb2005, Elegant Ribbon 3.0)

I cannot create a Separator with Text?


My Code:

        ’Create DropDown

        Dim ribbongroup As Elegant.Ui.RibbonGroup = Me.RibbonGroup1

        Dim ribbonDD As New Elegant.Ui.DropDown

        ribbongroup.Controls.Add(ribbonDD)



        ribbonDD.Text = "My DD Label"

        ribbonDD.Name = "MyDDId"

        ribbonDD.Informativeness.FixedLevel = Elegant.Ui.RibbonGroupButtonInformativenessLevel.SmallImageWithText



        ’ Create PopUpMenu

        Dim pPopUp As New Elegant.Ui.PopupMenu

        ribbonDD.Popup = pPopUp



        ’ Create Items to Menu

        Dim newButton1 As New Elegant.Ui.Button

        newButton1.Text = "New Button1"

        Dim newButton2 As New Elegant.Ui.Button

        newButton2.Text = "New Button2"



        Dim ribbonSep As New Elegant.Ui.Separator

        pPopUp.BeginInit()

        pPopUp.Items.Add(newButton1)

        pPopUp.Items.Add(ribbonSep)

        pPopUp.Items.Add(newButton2)

        pPopUp.EndInit()



        ribbonSep.Text = "New Text"

        ribbonSep.Name = "sepTest"



        ’ Next Line > ERROR

        ribbonSep.Informativeness.FixedLevel = Elegant.Ui.PopupMenuSeparatorInformativenessLevel.SeparatorWithText


What´s wrong?


Thanks for your help

Gunter

Technical Support Jun 2, 2008 - 4:33 AM

The same control can have different informativeness types in different contexts depending on the container control it belongs to. In this case, due to performance issues, the menu was not fully initialized and informativeness type was undetermined. The same problems we came across in the VB.NET Designer. That’s why we developed an alternative way to set the informativeness level. Try the following code instead of the last line:

ribbonSep.InformativenessFixedLevel = "Elegant.Ui.PopupMenuSeparatorInformativenessLevel:SeparatorWithText"
This should help. Thank you.

Gunter Avenius Jun 2, 2008 - 6:36 AM

Hello,


Thanks, that helps.


Best regards

Gunter