|
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace JGCreateDataClasses
{
/// <summary>
/// Class based on RichTextBox with ability to pick DB Type
/// </summary>
class JISTextBox : System.Windows.Forms.RichTextBox
{
JCSDropdown m_csDropDown;
public JISTextBox()
{
m_csDropDown = new JCSDropdown();
m_csDropDown.WordSelected += new JCSDropdown.WordSelectedEventHandler(dropDown_WordSelected);
}
void dropDown_WordSelected(object sender, string wordText)
{
this.AppendText(wordText);
}
protected override void OnKeyDown(KeyEventArgs e)
{
base.OnKeyDown(e);
if (e.KeyData == Keys.F2)
{
e.Handled = true;
Point pt = this.GetPositionFromCharIndex(this.SelectionStart);
if (pt.X < 5)
{
pt.Offset(0, this.Font.Height);
pt = this.PointToScreen(pt);
m_csDropDown.Show(pt);
}
}
}
// Called externally when DB Path set
internal void FillBoxes()
{
m_csDropDown.ControlInitialise();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I have been a keen hobbyist programmer since getting my first computer - a Vic 20 (you had to be able to write programs then since few programs were available and all were expensive).
Retired and now living in Pewsey, Wiltshire, where I spend (far too much of) my time writing computer programs to keep my mind active.