C1Ribbon2.0 button click issue

Posted by: svageesan on 22 October 2019, 1:11 am EST

    • Post Options:
    • Link

    Posted 22 October 2019, 1:11 am EST

    I’m using c1Ribbon version 2.0.20172.271 in my C#.NET project built with VS2017 (DotNet4.6).

    When I do a quick click on the ribbon button (click and move mouse immediately) then the button click event is not fired.

    But when I click and don’t move the mouse (keep in same location for a second) then button click event is fired for that ribbon button.

    I want the click event to fire irrespective of the click&move or click&stay mouse events. How to fix this issue?

    Thanks in advance.

    Regards,

    Siva

  • Posted 22 October 2019, 11:41 pm EST

    Hello,

    MouseClick event fires for a control when mouse button is released on the control itself. This is the default behavior with MicroSoft controls also. If you click on the MS button then hold the mouse button and release it out of the button , MouseClick event will not fire but if you click on the button then hold the mouse button and move the cursor out of the button and then release it on the button itself, MouseClick event will fire.​

    In MS button case you can use MouseDown event but in C1Ribbon MouseDown event is not there so you need to handle it by the one of the following ways given below :

    1 : Use MouseDown event of C1Ribbon as given in code snippet below :

    private void C1Ribbon1_MouseDown(object sender, MouseEventArgs e)
           {
               var clickedElmnt = c1Ribbon1.HitTest(e.Location);
               if (clickedElmnt != null && clickedElmnt.GetType().BaseType.Name == "ButtonElement")
               {
                   if (c1Ribbon1.Bounds.Contains(clickedElmnt.Bounds))
                   {
                       MessageBox.Show("Ribbon button clicked");
                   }
               }
           }
    

    2 : You can also use MouseLeave and MouseEnter event of RibbonButton to handle MouseDown event of C1Ribbon as given in code snippet below :

       ```
    

    bool temp = true;

    private void RibbonButton1_MouseLeave(object sender, EventArgs e)

    {

    temp = false;

    }

    private void RibbonButton1_MouseEnter(object sender, EventArgs e)

    {

    temp = true;

    }

    private void C1Ribbon1_MouseDown(object sender, MouseEventArgs e)

    {

    if (temp)

    {

    MessageBox.Show(“Ribbon button clicked”);

    }

    }

    
    Please go through the attached sample demonstrating both the above given solutions.
    
    Regards,
    Prabhat Sharma.
    [zip filename="RibbonButtonClick.zip"]https://gccontent.blob.core.windows.net/forum-uploads/file-7936e2ae-999d-482a-bdd4-07d0cef9418f.zip[/zip]
  • Posted 31 October 2019, 2:48 am EST

    Prabhat,

    Thanks for your reply. But the same was working in the “C1.Win.C1Ribbon.2, Version=2.0.20102.274” which was used before.

    The problem is not in “click drag release outside” action. The problem is quick click on the button is not triggering the click event at all.

    Some of my users are very fast in clicking the buttons as they have been using our software for long time and comfortable in the locations. But when the click and release fast even in the same control, the click is not fired.

    You can try this in MS Outlook, and compare with the same quick with a ribbon sample application to see the difference.

    Let me know if I can expect a solution.

    Best Regards,

    Siva

  • Posted 31 October 2019, 6:19 pm EST

    Hello,

    I have checked at my end with 2.0.20102.274, 2.0.20172.271, 2.0.20192.375 build of C1Ribbon.

    All are showing the same behavior at my end. If I click and move very fast then click event does not fire. Also, the same behavior is observed with MS Word also.

    Thanks,

    Mohit

  • Posted 5 November 2019, 12:31 am EST

    Dear Mohit,

    Thanks for your reply but I believe the same case is not true with our application built with 2.0.20102.274 & 2.0.20172.271. I can send you video files recorded with both versions of product build to show the problem. Please share me your email ID so that I can share the link for the video files download.

    I believe there is a property change done to C1Ribbon which is causing this error.

    Best Regards,

    Siva

  • Posted 5 November 2019, 4:41 pm EST

    Hello Siva,

    Please drop your video files at the following link:

    https://www.dropbox.com/request/jIfpi7jfB4AlYqeZhep5

    Thanks,

    Mohit

  • Posted 5 November 2019, 4:47 pm EST

    Hi Siva,

    I have also created a ticket for you on our private support portal i.e. SupportOne. Please follow the link given below for further processing.

    https://supportone.componentone.com/home/casedetail/404562

    You can share all your information here. This information will be visible to you and us only.

    You can use your Forum account for login to SupportOne.

    Thanks,

    Mohit

  • Posted 5 November 2019, 6:35 pm EST

    I shared the videos in SupportOne as per your advice. Please do the needful.

    Thanks in advance.

    Regards,

    Siva

  • Posted 20 February 2020, 9:29 pm EST

    Did you see the videos? Any update for my query?

    The old controls were working fine.

  • Posted 20 February 2020, 9:31 pm EST

    Can you tell more more details about RepeatPressDelay and RepeatPressInterval properties of the new RibbonButton controls. These were not there in old controls which was working fine. I think introduction of these new properties has side effect of this issue.

  • Posted 24 February 2020, 10:17 pm EST

    Hello,

    I have replied on the following case:

    https://supportone.componentone.com/home/casedetail/404562

    Could you please reply to the above case only to avoid the confusion.

    Thanks,

    Mohit

  • Posted 24 May 2020, 2:03 am EST

    hi…

    I have a problem with the following command in programming, please help.

    RibbonButton1 is not control. its C1.win.C1RibbonButton

    C1SuperTooltip1.Show(“text”, RibbonButton1)

    C1SuperTooltip1.Hide(RibbonButton1)

    please sample show and hide C1SuperTooltip for RibbonButton

    tnx.

  • Posted 25 May 2020, 4:06 pm EST

    Hello,

    Your case has been replied on the given link:

    https://www.grapecity.com/forums/c1-studio/performance-problem#hi-saeedbribbonbutton1-is-

    Regards,

    Prabhat Sharma.

  • Posted 4 July 2020, 1:26 am EST

    Prabhat,

    The issue is reproducible if you have 2 builds one with VS2008 and other with VS2017.

    Now with VS2017, when I try your suggestion, how do I send the click event back to that ribbon button. The OnClick is protected method, Invoke can’t be called as RibbonButton is not derived from system Control.

    clickedElmnt.OnClick(args) is required but not available.

    Why such limitations???

    Stuck with this…

    Regards,

    Siva


    : Use MouseDown event of C1Ribbon as given in code snippet below :

    private void C1Ribbon1_MouseDown(object sender, MouseEventArgs e)

    {

    var clickedElmnt = c1Ribbon1.HitTest(e.Location);

    if (clickedElmnt != null && clickedElmnt.GetType().BaseType.Name == “ButtonElement”)

    {

    if (c1Ribbon1.Bounds.Contains(clickedElmnt.Bounds))

    {

    MessageBox.Show(“Ribbon button clicked”);

    }

    }

    }

  • Posted 5 July 2020, 3:21 pm EST

    Hi Siva,

    >>The issue is reproducible if you have 2 builds one with VS2008 and other with VS2017.

    Can you please mention the build version that you are using at your end and also mention the exact steps that you are performing to replicate the issue?

    >>Now with VS2017, when I try your suggestion, how do I send the click event back to that ribbon button.

    For this, a new property named PerformClick will be introduced for the C1RibbonButton in the next release i.e. 2020V2.

    If you doing something else then please let us know.

    Regards,

    Prabhat Sharma.

  • Posted 6 July 2020, 7:32 pm EST

    Prabhat,

    Thanks for your reply.

    C1.Win.C1Ribbon.2, Version=2.0.20102.274 was used with VS2008 - Working well.

    C1.Win.C1Ribbon.2, Version=4.0.20201.416 is used with VS2017 - not working.

    Videos already shared. Please see thread above.

    Good to know you are going to add PerformClick. But since it is an urgent requirement for my important customer, can you share the approx date for release.

    If not I need to store the delegate for each button and reuse it with logic.

    Regards,

    Siva

  • Posted 8 July 2020, 9:10 pm EST

    Hi Siva,

    >>Videos already shared. Please see the thread above.

    As said in the SuppostOne case that we observed the same behavior at our end with both builds.

    We have attached a sample in the SupportOne case, can you please try this with both the builds and share your observations via GIF or a video file.

    If you are doing something else as implemented in the sample then please let us know and modify the sample accordingly.

    https://supportone.componentone.com/home/casedetail/404562

    Could you please reply to the above case only to avoid the confusion.

    >>can you share the approx date for release.

    As per the developers, the ETA is in the starting week of August.

    Note: The case over S1 gets closed automatically after 5 days if there is no active conversation but you can reopen it anytime as per your need.

    Regards,

    Prabhat Sharma.

  • Posted 11 July 2020, 2:08 am EST

    Dear Prabhat,

    Will wait for release in august.

    Regards,

    Siva

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels