Hi,
I am using Tx Text Control .Net Windows form Version 15.0 in C# based project.
I have implemented textControl1_ImageClicked() event. This event is supposed to be called every time, I click on an image contained in Tx Text Control. But, what is happening is that, sometime this event is not called event I click on image multiple times.
Problem is it works sometime and sometime it doesn't.
Thanks in advance.
Below is the code to add an image to TxText Control
I am using Tx Text Control .Net Windows form Version 15.0 in C# based project.
I have implemented textControl1_ImageClicked() event. This event is supposed to be called every time, I click on an image contained in Tx Text Control. But, what is happening is that, sometime this event is not called event I click on image multiple times.
Problem is it works sometime and sometime it doesn't.
Thanks in advance.
Below is the code to add an image to TxText Control
Code:
private void AddCheckboxImage_ButtonClick(object sender, EventAgrs e)
{
TXTextControl.Image imgCheckboxChecked = new TXTextControl.Image();
imgCheckboxChecked.FileName = AppDomain.CurrentDomain.BaseDirectory + @"Resources\CheckboxSelected.bmp";
imgCheckboxChecked.Sizeable = false;
imgCheckboxChecked.Moveable = true;
imgCheckboxChecked.HorizontalScaling = 100;
imgCheckboxChecked.VerticalScaling = 100;
imgCheckboxChecked.SaveMode = ImageSaveMode.SaveAsFileReference;
textControl1.Images.Add(imgCheckboxChecked, textControl1.InputPosition.TextPosition);
}
Below is code from ImageClick event:
private void textControl1_ImageClicked(object sender, ImageEventArgs e)
{
//if document is on type word then toggle the checkbox state by toggling the image
if (e.Image.FileName.Contains("CheckBoxUnchecked"))
{
textControl1.Images.Remove(e.Image);
TXTextControl.Image imgCheckboxChecked = new TXTextControl.Image();
imgCheckboxChecked.FileName = AppDomain.CurrentDomain.BaseDirectory + @"Resources\CheckboxSelected.bmp";
imgCheckboxChecked.Sizeable = false;
imgCheckboxChecked.Moveable = false;
imgCheckboxChecked.HorizontalScaling = 100;
imgCheckboxChecked.VerticalScaling = 100;
imgCheckboxChecked.SaveMode = ImageSaveMode.SaveAsFileReference;
textControl1.Images.Add(imgCheckboxChecked, textControl1.InputPosition.TextPosition);
}
else if (e.Image.FileName.Contains("CheckboxSelected"))
{
textControl1.Images.Remove(e.Image);
TXTextControl.Image imgCheckboxUnchecked = new TXTextControl.Image();
imgCheckboxUnchecked.FileName = AppDomain.CurrentDomain.BaseDirectory + @"Resources\CheckBoxUnchecked.bmp";
imgCheckboxUnchecked.Sizeable = false;
imgCheckboxUnchecked.Moveable = false;
imgCheckboxUnchecked.HorizontalScaling = 100;
imgCheckboxUnchecked.VerticalScaling = 100;
imgCheckboxUnchecked.SaveMode = TXTextControl.ImageSaveMode.SaveAsFileReference;
textControl1.Images.Add(imgCheckboxUnchecked, textControl1.InputPosition.TextPosition);
}
}