- Point scrollLoc = Point.Empty;
- bool isImageSelected = false;
- private void textControl1_ImageSelected(object sender, TXTextControl.ImageEventArgs e)
- {
- this.scrollLoc = this.textControl1.ScrollLocation;
- this.isImageSelected = true;
- }
- private void textControl1_VScroll(object sender, EventArgs e)
- {
- if (this.isImageSelected
- && this.scrollLoc.Y != this.textControl1.ScrollLocation.Y)
- {
- this.textControl1.ScrollLocation = this.scrollLoc;
- this.isImageSelected = false;
- }
- }
复制代码 |