Can anyone recommend a text editing control that can lock portions of text... ?

cjard

Well-known member
Joined
Apr 25, 2006
Messages
7,081
Programming Experience
10+
Hi all


I want to programmatically create database stored procedures, and the text must obey a template. To provide some visiblity of what the user is doing, I want to programmatically generate the procedure header, have them type the body, and generate the footer myself too

To this end, the text has 3 parts:

CREATE PROCEDURE ____ (arguments...) IS BEGIN
<body part, user editable>
END PROCEDURE

Does anyone know of an edit control I can use to lock the portions of the text I can create programmatically (it is important that the parameters be nanmed a certain way and be in the right order.

Currently Im thinking of:

VB.NET:
[/FONT]
[FONT=Courier New]--------------------------------------------------+[/FONT]
[FONT=Courier New]|  tablelayout panel                              |[/FONT]
[FONT=Courier New]| +---------------------------------------------+ |[/FONT]
[FONT=Courier New]| | label, autosize, multiline, white background| |[/FONT]
[FONT=Courier New]| +---------------------------------------------+ |[/FONT]
[FONT=Courier New]| +---------------------------------------------+ |[/FONT]
[FONT=Courier New]| | textbox, autosize, multiline, white backgrnd| |[/FONT]
[FONT=Courier New]| +---------------------------------------------+ |[/FONT]
[FONT=Courier New]| +---------------------------------------------+ |[/FONT]
[FONT=Courier New]| | label, autosize, multiline, white background| |[/FONT]
[FONT=Courier New]| +---------------------------------------------+ |[/FONT]
[FONT=Courier New]+-------------------------------------------------+[/FONT]
[FONT=Courier New]

The labels are hence locked, and the textbox text is the sql query that the procedure runs etc..

ANyone know a component where I can do this without compounding labels etc?
 
you could supply a panel simply with the textbox's placed in the specific spots for the user to type in the 'body' then above and below each user editable textbox place another textbox with the readonly property set to true so the user can still copy and paste but not edit

it'll be a lot of alignment stuff, but you can prolly get it to be pretty slick with enough time

VB.NET:
[FONT=Courier New]+-------------------------------------------------------------+[/FONT]
[FONT=Courier New]|  tablelayout panel                                          |[/FONT]
[FONT=Courier New]| +---------------------------------------------------------+ |[/FONT]
[FONT=Courier New]| | Textbox, autosize, multiline, white background, readonly| |
[/FONT][FONT=Courier New]| +---------------------------------------------------------+ |[/FONT]
[FONT=Courier New]| +---------------------------------------------------------+ |[/FONT]
[FONT=Courier New]| | textbox, autosize, multiline, white background          | |
[/FONT][FONT=Courier New]| | top = other top + hieght                                | |[/FONT]
[FONT=Courier New]| +---------------------------------------------------------+ |[/FONT]
[FONT=Courier New]| +---------------------------------------------------------+ |[/FONT]
[FONT=Courier New]| | Textbox, autosize, multiline, white background, readonly| |
[/FONT][FONT=Courier New]| | top = other top + height                                | |[/FONT]
[FONT=Courier New]| +---------------------------------------------------------+ |[/FONT]
[FONT=Courier New]+-------------------------------------------------------------+[/FONT]

turn this into a custom control then simply make new instances of it passing passing the name of the procedure as a property which'll be shown in the top readonly textbox
 
Back
Top