in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

RibbonEditBox and EditMask

Last post 06-26-2008 6:54 AM by C1_AndreyD. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 04-28-2008 4:25 PM

    RibbonEditBox and EditMask

    I need to add an edit mask to a RibbonEditBox. I see from the documentation that it's not supported. Has anyone found a workaround? Also, are there any plans to add this functionality by ComponentOne?

     Thanks in advance.

    Filed under: ,
  • 04-28-2008 4:40 PM In reply to

    Re: RibbonEditBox and EditMask

    We plan to add the RibbonMaskedEditBox component in the next version.
    With the current version you can embed the standard MaskedTextBox
    control into the RibbonControlHost.

    Regards,

    -Andrey
  • 04-28-2008 6:53 PM In reply to

    Re: RibbonEditBox and EditMask

    Andrey:

    Thanks for the quick response. I'm not familiar with the RibbonControlHost. I searched online help and the forums and found only an example in VB. Can you point me to any documentation and some C# sample code.

     

    Thanks in advance. 

  • 04-28-2008 7:34 PM In reply to

    Re: RibbonEditBox and EditMask

    You may download a C# sample using the following link:

    http://download3.componentone.com/pub/Net/c1ribbon/misc/ControlHostDemo.zip

    Here is an except from the readme file about RibbonControlHost:

    =======================================================
    Ribbon Build Number [2.0.20082.84] Released: [March 25, 2008]
    =======================================================

    - Added the RibbonControlHost element. It allows to embed
    an arbitrary control into the C1Ribbon.

    For example, let's add the TextBox control to a ribbon
    group. We have to define the following class:

    VB:

    Public Class TextBoxHost
    Inherits C1.Win.C1Ribbon.RibbonControlHost

    Public Sub New()
    MyBase.New(New System.Windows.Forms.TextBox())
    End Sub

    End Class

    C#:

    public class TextBoxHost : C1.Win.C1Ribbon.RibbonControlHost
    {
    public TextBoxHost()
    : base(new System.Windows.Forms.TextBox())
    {
    }
    }

    Now we should build the project and open a form with the
    C1Ribbon control in the designer.

    Open the action floatie for the RibbonGroup, then select
    "Add ControlHost". This will open a dialog box where you
    should type the class name of our control host, such as
    "RibbonApplication1.TextBoxHost". When you click the OK
    button the control will be added to the ribbon group.

    Next time, when you want to add the TextBoxHost element
    you don't have to type its name. The name of this class
    can be selected from the drop-down list in the "Adding
    RibbonControlHost" dialog box.

    The RibbonControlHost class publishes the standard
    properties and events of the hosted control. To access
    other properties, methods, and events of the hosted
    control use the RibbonControlHost.Control property.

    It is also possible to override methods such as
    RibbonControlHost.OnSubscribeControlEvents to handle
    events raised by the hosted control. You can put custom
    functionality into properties to enhance the hosted control.
    =======================================================

    Hope it will help.

    Regards,

    -Andrey
  • 06-25-2008 12:52 AM In reply to

    Re: RibbonEditBox and EditMask

     Hello,

    I have C1Ribbon 2.0.20082.93, VS2005, .NET 2.x. When I do Add ControlHost from the RibbonGroup level, it crashes my VS2005.

    This happens in the ControlHostDemo solution. When I go and try to debug when I get this message it says that "one of the types could not be loaded". 

    Any idea what may be going wrong?

    Thanks.

    Regards,

    Georgi 

  • 06-25-2008 6:00 AM In reply to

    Re: RibbonEditBox and EditMask

    Hi Georgi,

    Thank you for reporting this problem. It must be fixed in the next build of C1Ribbon:

    http://download3.componentone.com/pub/Net/c1ribbon/misc/C1Ribbon.2_2.0.20082.101.zip

    Please let me know if this won't help.

    Regards,

    -Andrey
  • 06-25-2008 3:18 PM In reply to

    Re: RibbonEditBox and EditMask

     Hi Andrey,

    Thanks, that worked!

    If I don't use the web browser control in the ControlHostDemo, would I need AxInterop.SHDocVw.DLL and Interop.SHDocVw.DLL as part of my deployment? Does the ControlHost functionality in C1Ribbon depend on any of these DLLs?

    Thanks.

    Regards,

    Georgi 

  • 06-25-2008 3:24 PM In reply to

    Re: RibbonEditBox and EditMask

    > Does the ControlHost functionality in C1Ribbon depend on any of these DLLs?

    No. It does not depend on these dlls. They are used by the SHDocVw control.
    C1.Win.C1Ribbon.2.dll is the only dll that is required at runtime.

    Regards,

    -Andrey
  • 06-25-2008 8:09 PM In reply to

    Re: RibbonEditBox and EditMask

     Hi Andrey,

    Using the Add ControlHost, is it possible to create a RibbonControlHost control that inherits the same painting behaviour as the current default paint (smooth animation of the current visual style stretched image as a background of a ribbon TAB). Right now, whatever the background of the custom RibbonControlHost control is, that's what's shown on the Ribbon Tab.

     I am just looking for a way to plug-in custom Ribbon Tabs and abstract certain Tabs that are common for a Ribbon. In particular, we have a Search Ribbon that consists of 2 Tabs - Search Control and Search Criteria. I'd like to keep the Search Control common for all our screens/forms and only plug in custom Search Criteria Tabs into a Ribbon. What's the best way to do something like this?

    I suppose I can have a UserControl that holds a default SearchRibbon that has an empty protected Search Criteria Tab and a private Search Control Tab and extend that as concrete ribbons with concrete Search Criteria added to the respected Tab? Any thoughts?

    Thanks. I appreciate your time.

    Regards,

    Georgi
     

  • 06-26-2008 6:54 AM In reply to

    Re: RibbonEditBox and EditMask

    Hi Georgi,

    > Using the Add ControlHost, is it possible to create a RibbonControlHost control that inherits
    > the same painting behaviour as the current default paint (smooth animation of the current visual
    > style stretched image as a background of a ribbon TAB). Right now, whatever the background
    > of the custom RibbonControlHost control is, that's what's shown on the Ribbon Tab.

    There are problems with smooth animation. It would be better to set the HotTransitionEffect
    property of C1Ribbon to False. The correct background appears if you set the BackColor
    of the user control to Transparent. See the attached sample for example.

    > I am just looking for a way to plug-in custom Ribbon Tabs and abstract certain Tabs that are
    > common for a Ribbon. In particular, we have a Search Ribbon that consists of 2 Tabs - Search
    > Control and Search Criteria. I'd like to keep the Search Control common for all our
    > screens/forms and only plug in custom Search Criteria Tabs into a Ribbon. What's the best
    > way to do something like this?

    In this case I would rather avoid using a UserControl. It may be more convenient to create
    the Search Criteria tab programmatically from a virtual method that will be overridden in
    derived forms. The Search Control tab can also be created programmatically for easy
    maintenance in the future.

    Regards,

    -Andrey
Page 1 of 1 (10 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.