Apr 23, 2013 at 11:50 AM
Edited Apr 26, 2013 at 12:22 AM
I want to be able to load (ie make visual) a custom task pane via a check box. The following is the code that I have added. I added a simple 150 x 150 usercontrol.
I cannot seem to link up the checkbox1state with the custom task pane (user control). I want to be able to dock the pane both left and right and float it.
I also want to added the following functionality:
- If the user closes the pane the checkbox is unchecked
- When the user rechecks the chextbox, the pane is displayed where the user last had it
Any assistance would be greatly appreciated.
In the RibbonUI.xml I have added the xml statement
<checkBox id="CheckBox1" label="Picture Table Editor Pane" onAction="CheckBox1_Pressed"/>
And I have added the following lines of code to Addin.vb (I added the message boxes as a means to test if the ribbon check box was working - so this can be removed)
Dim myUserControl As New UserControl1()
Dim CheckBox1State As Boolean
Public Sub CheckBox1_Pressed(ByVal control As Office.IRibbonControl, ByVal CheckBox1State As Boolean)
myUserControl.Dock = MsoCTPDockPosition.msoCTPDockPositionLeft
myUserControl.Width = 300
If CheckBox1State Then
MessageBox.Show("Checkbox is Checked")
myUserControl.Visible = True
MessageBox.Show("Checkbox is Unchecked")
myUserControl.Visible = False