Click here to Skip to main content
15,901,284 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hi all
how can i format a selected text in text box and then save the text with formats in a database ???
any help
Updated 8-Jan-20 6:41am
Sander Rossel 27-Nov-11 16:11pm    
What kind of formats are we talking about? First thing that comes to mind is String.Format...
[no name] 27-Nov-11 20:50pm    
Hi sirwan,
please share us the format you want.
Pete BSC 27-Nov-11 16:25pm    
Are you using Data Binding?
Yvan Rodrigues 27-Nov-11 21:55pm    
Windows Forms or Web Forms? or WPF?

1 solution

Use 'selectedtext' property of Textbox class (supports from .net 4.0) as follows

Dim a As String
        a = txtdemo.SelectedText
        lbltest.Text = Format(a, "\")

In place of "lbltest" you can use insert script into database
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900