hasanma Posted August 10, 2007 Report Share Posted August 10, 2007 I've a function to perform Custom Zooming In & Out. How can I hook up this in the Zoom button(command) in the toolbar? Quote Link to comment Share on other sites More sharing options...
Frank Posted August 11, 2007 Report Share Posted August 11, 2007 You can override any command functionality by capturing the InternalCommand event. Quote Link to comment Share on other sites More sharing options...
hasanma Posted August 13, 2007 Author Report Share Posted August 13, 2007 I'm using the folloing code to create a command & then the handler. By doing this I get a new Tool bar button. That not exactly what I want to do. I want my "Zoom Off" command to replace the ChartFX "Zoom" toolBar command. How can I do that. Also, I couldn't fire InternalCommand event as you suggested. chart2.Commands.AddCommand(4); chart2.Commands[4].Enabled = true;chart2.Commands[4].Text = "Zoom Off"; chart2.ToolBarObj[15] = 4; // I'm just using 15 because I don't know what to use chart2.UserCommand += new CommandUIEventHandler(chart2_UserCommand); Quote Link to comment Share on other sites More sharing options...
Frank Posted August 18, 2007 Report Share Posted August 18, 2007 The InternalCommand event is there with all the other events. I don't know why you don't see it. You can also replace the Zoom button in the toolbar with any command, either pre-defined or custom. In the default toolbar, the Zoom button is index 18 (separators count as items too). Note: Because of the location of this posting I am assuming you are using Chart FX for VS 2005 Windows Form control. Quote Link to comment Share on other sites More sharing options...
hasanma Posted August 20, 2007 Author Report Share Posted August 20, 2007 Is there any way to get the value of Zoom tolbar button using code rather than hardcoding the value to 18. Quote Link to comment Share on other sites More sharing options...
Frank Posted August 20, 2007 Report Share Posted August 20, 2007 Yes. You can loop through the Items and find the one that has CommandId.Zoom as the command Id. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.