Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created July 24, 2017 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/88a405105cc6eb77fbd981a0cb8a61b3 to your computer and use it in GitHub Desktop.
Save bjoerntx/88a405105cc6eb77fbd981a0cb8a61b3 to your computer and use it in GitHub Desktop.
public partial class Form1 : TXTextControl.Windows.Forms.Ribbon.RibbonForm
{
public Form1()
{
InitializeComponent();
textControl1.InputPositionChanged += TextControl1_InputPositionChanged;
textControl1.FrameSelected += TextControl1_FrameSelected;
textControl1.FrameDeselected += TextControl1_FrameDeselected;
textControl1.DrawingActivated += TextControl1_DrawingActivated;
textControl1.DrawingDeselected += TextControl1_DrawingDeselected;
}
private void TextControl1_DrawingDeselected(object sender,
TXTextControl.DataVisualization.DrawingEventArgs e)
{
if ((textControl1.Frames.GetItem() == null) &&
(textControl1.Drawings.GetActivatedItem() == null))
{
m_grpFrameTools.Visible = false;
}
}
private void TextControl1_DrawingActivated(object sender,
TXTextControl.DataVisualization.DrawingEventArgs e)
{
m_grpFrameTools.Visible = true;
}
private void TextControl1_FrameDeselected(object sender,
TXTextControl.FrameEventArgs e)
{
if ((textControl1.Frames.GetItem() == null) &&
(textControl1.Drawings.GetActivatedItem() == null))
{
m_grpFrameTools.Visible = false;
}
}
private void TextControl1_FrameSelected(object sender,
TXTextControl.FrameEventArgs e)
{
m_grpFrameTools.Visible = true;
}
private void TextControl1_InputPositionChanged(object sender, EventArgs e)
{
m_grpTableTools.Visible = textControl1.Tables.GetItem() != null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment