1. How can we change the ButtonTool's width individually. When I set the MaxWidth/Width/MinWidth of a ButtonTool, I am always told that The MaxWidth property cannot be set for a Infragistics.Win.UltraWinToolbars.ButtonTool tool.
2. Infragistics.Win.UltraWinToolbars.ButtonTool, we need MouseDown event. How do we be notified by the event? It's not available to us, I think.
3. Can we control how the UltraTab to be loaded. From what I feel is that ultratab/ultracontrol are created asynchronizely. Can we create the ultra control in the synchronized means?
Thanks.
This is not a WPF control, so XAML is not used.
It looks like I missed a step in my original post. There is no MouseDown event on the UIElement. You have to hook this event on the Control of the element. This following code shows an example of this:
ToolBase buttonToolInstance;private void Form1_Shown( object sender, EventArgs e ){ this.buttonToolInstance = this.ultraToolbarsManager1.Toolbars[ 0 ].Tools[ "ButtonTool2" ];
if ( this.buttonToolInstance.UIElement != null ) this.buttonToolInstance.UIElement.Control.MouseDown += new MouseEventHandler( Control_MouseDown );}
private void Control_MouseDown( object sender, MouseEventArgs e ){ if ( this.buttonToolInstance.UIElement.Rect.Contains( e.Location ) ) MessageBox.Show( "Mouse Down on ButtonTool2." );}
Hi, I am trying to achieve your answer to question 2 above to hook the MouseDown event to the ButtonTool's UIElement property, but I'm unable to do it. Could you tell me the XAML required to do this please?
Thanks,
Jason
Developer (Barclays Capital)
zhenghong04 said:1. How can we change the ButtonTool's width individually. When I set the MaxWidth/Width/MinWidth of a ButtonTool, I am always told that The MaxWidth property cannot be set for a Infragistics.Win.UltraWinToolbars.ButtonTool tool.
The ButtonTool does not support having it's width set. These properties are for editor tools and the LabelTool only.
zhenghong04 said:2. Infragistics.Win.UltraWinToolbars.ButtonTool, we need MouseDown event. How do we be notified by the event? It's not available to us, I think.
The event is not publicly exposed on the ButtonTool, but you can hook the MouseDown of the ButtonTool's UIElement property. You must access this property on the instance tool (the tool from the Tools collection of the toolbar, menu, or ribbon group which owns it). Keep in mind, the UIElement can be null if the tool is not visible.
zhenghong04 said:3. Can we control how the UltraTab to be loaded. From what I feel is that ultratab/ultracontrol are created asynchronizely. Can we create the ultra control in the synchronized means?
The tab control is not loaded asynchronously. What is it you are looking to accomplish with the tab control?