SqlLighter Control
| Soruce Code :Download | ||
| Executable : Download | ||
| Windows forms provides us with the RichTextBox that provides us with rich editing featues like colors , fonts and other formatting options. | ||
| The SqlLighter control is just an extension of using this windows control to beautify a SQL statament that I developed as part of an existing project. This project is implemented as a "Windows Control Library". | ||
| Although I have covered most of the keywords, operators , operands that can be highlighted, the control has additional flexibility to add any other keywords that you wish to highlight using public functions like. | ||
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
| The important event to look for here is the TextChange event sent by the RichTextBox. | ||
| private void RichSQLBox_TextChanged(object sender, System.EventArgs e) { PROCESS(); } |
||
| Execute the Process function to check for text you entered and process accordingly | ||
| private void PROCESS() { LockWindowUpdate(RichSQLBox.Handle); int selStart = RichSQLBox.SelectionStart ; string[] s = RichSQLBox.Text.Split(null); pos = RichSQLBox.Text.IndexOf(orig,pos); } RichSQLBox.SelectionStart = selStart; |













No comments yet... Be the first to leave a reply!