Problem with TextBox
-
HI Folks i use a text box for my applicationa nd am right nowhaving 2 problems that i need to address. 1). Whenever that text box gains focus for user to input data the cursor goes and stands right in the middle of the first line,While i want it to stand at the extreme left ahnd top corner.Now what property of the textbox do i need to meddle with to get what i want.i tried so many things but nothing seems to work. 2). when i use the ' symbol in my data input inside the text box like say "I've a good car" im not able to input data inside the databse becos of the "'" symbols importance in a database.now how do i overcome it.do i ahve to search for every text in my text box for that occurence and change it to something else?? Regards Pradhip Swaminathan Why Need Parking lots in Bars when Drunken Driving is Prohibited
-
HI Folks i use a text box for my applicationa nd am right nowhaving 2 problems that i need to address. 1). Whenever that text box gains focus for user to input data the cursor goes and stands right in the middle of the first line,While i want it to stand at the extreme left ahnd top corner.Now what property of the textbox do i need to meddle with to get what i want.i tried so many things but nothing seems to work. 2). when i use the ' symbol in my data input inside the text box like say "I've a good car" im not able to input data inside the databse becos of the "'" symbols importance in a database.now how do i overcome it.do i ahve to search for every text in my text box for that occurence and change it to something else?? Regards Pradhip Swaminathan Why Need Parking lots in Bars when Drunken Driving is Prohibited
- Try this in the
Focus
event:TextBox1.SelectionStart = 0
andTextBox1.SelectionLength = 0
(In VB6, these are calledSelStart
andSelLength
) sValue = TextBox1.Text.Replace("'","''")
,
or in VB6,sValue = Replace(TextBox1.Text, "'", "''")
- Try this in the