Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
rajender
Starting Member
13 Posts |
Posted - 2005-06-30 : 03:29:51
|
| Hi TeamI don't know whether it is right place to ask this question or not. I am developing a SQL-DMO application where i need to display SQL Scripts with reserved keywords in color like the Query Window of Sql Analyzer displays. I am using sqlparser.dll to parse the script into RTF format much like this\cf1 CREATE\cf \cf1 TABLE\cf \cf5 [\cf \cf10 card_types\cf \cf5 ]\cf \cf5 (\cf \par \cf5 [\cf \cf10 card_type_id\cf \cf5 ]\cf \cf5 [\cf \cf2 int\cf \cf5 ]\cf \cf1 IDENTITY\cf \cf5 (\cf \cf7 1\cf \cf5 ,\cf \cf7 1\cf \cf5 )\cf \cf5 NOT\cf \cf5 NULL\cf \cf5 ,\cf \par \cf5 [\cf \cf1 name\cf \cf5 ]\cf \cf5 [\cf \cf2 varchar\cf \cf5 ]\cf \cf5 (\cf \cf7 50\cf \cf5 )\cf \cf1 COLLATE\cf \cf10 SQL_Latin1_General_CP1_CI_AS\cf \cf5 NOT\cf \cf5 NULL\cf \cf5 ,\cf \par \cf1 PRIMARY\cf \cf1 KEY\cf \cf1 CLUSTERED\cf \par \cf5 (\cf \par \cf5 [\cf \cf10 card_type_id\cf \cf5 ]\cf \par \cf5 )\cf \cf1 ON\cf \cf5 [\cf \cf1 PRIMARY\cf \cf5 ]\cf \par \cf5 )\cf \cf1 ON\cf \cf5 [\cf \cf1 PRIMARY\cf \cf5 ]\cf \par \cf1 GO\cf \par \par \par Now my problem is neither Textbox nor RichTextBox control is able to display it the way i want. I also tried word document thru VB code to display this text, but it displayed without color. Can anybody know which control/component/library SQL Query Analyzer uses or is there any other control that i can use.Thanks in advance.Rajender Kr. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-06-30 : 07:09:57
|
This is presentation layer issueIf you use VB6 then, you can split the text and set the color accordinglyRichTextBox1.SelStart = 0RichTextBox1.SelLength = 10RichTextBox1.SelColor = vbBlueRichTextBox1.SelStart = 11RichTextBox1.SelLength = 20RichTextBox1.SelColor = vbRedRichTextBox1.SelStart = Len(RichTextBox1.Text) Something like thatHerafter, Post your question at relevent forum MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|