473,383 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Trouble finding the proper control

hi! i in the midst of a project and i am stuck.
i have 2 queies:
1) i want a control that would look like a text box, i.e, have several typed lines in it, and clicking on any particular line will select the entire line. is there any control or object already present, or do i have to create one. if i have to create, how would i go about it...... please help.

2) is there any way to change the background color of only one line in a rich text box. if yes, how?
Dec 31 '06 #1
1 905
Killer42
8,435 Expert 8TB
hi! i in the midst of a project and i am stuck.
i have 2 queies:
1) i want a control that would look like a text box, i.e, have several typed lines in it, and clicking on any particular line will select the entire line. is there any control or object already present, or do i have to create one. if i have to create, how would i go about it...... please help.
Seems as though the simplest thing here would be to use a listbox. But if it must be a textbox, you could use a standard one and code the selection yourself. Try this simplified sample...
Expand|Select|Wrap|Line Numbers
  1. Private Sub Text1_Click()
  2.   Static Busy As Boolean
  3.   If Not Busy Then
  4.     Busy = True
  5.     Text1.SelLength = 3
  6.     Busy = False
  7.   End If
  8. End Sub
  9.  
The idea of the Busy thing is to prevent your code from getting into a loop by triggering the same event that you're processing. The highlighted line (setting SelLEngth) is the simplified part - it just selects the three characters starting where you clicked, to illustrate the idea. At that point, you could scan backward/forward through the text to determine where the current line starts and ends, then set the selection (.SelStart & .SelLength properties) to highlight part of the text.

2) is there any way to change the background color of only one line in a rich text box. if yes, how?
I suspect not, but will leave this for someone who has more experience with the rich text box. Have you tried selecting the appropriate part of the text and then changing the property?
Jan 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: bj | last post by:
hello is there any chance to get proper char width for class derived from user control - im working over text editing control, so i need proper width of every character for currently selected...
15
by: cwsullivan | last post by:
Hi gang, I have a grid full of particles in my program, and I want to find an angle between two particles. I'm having trouble because it seems like the answer depends on whether or not the target...
59
by: Rico | last post by:
Hello, I have an application that I'm converting to Access 2003 and SQL Server 2005 Express. The application uses extensive use of DAO and the SEEK method on indexes. I'm having an issue when...
2
by: MLH | last post by:
I can't seem to find an A97 HELP blurb telling me how to make a specific Tab Page active from within VBA. I have a form with 3 tabs. They work great. I want to optionally make the first, second or...
5
by: Jim in Arizona | last post by:
How do I find a control within a datalist itemtemplate from a sub procedure that isn't a normal called procedure from a datalist (like the update, edit, or cancel procedures)? For instance,...
6
by: Nathan Sokalski | last post by:
I am trying to start using the AjaxControlToolkit. I followed all the instructions on the following page: http://ajax.asp.net/ajaxtoolkit/Walkthrough/Setup.aspx The only thing I did...
5
by: Fred Chateau | last post by:
I am trying to reference a server control in a user control, from the containing page. Is there a way to do that? I have tried "UserControl1.FindControl("ControlName")" but I get a null reference....
2
by: Rozzy | last post by:
Hi, I'm having trouble using the proper terminology, so bear with me, I am trying to submit text to a mysql database. I want to be able to allow formatting of this content (like breaking it up into...
4
by: karthik25 | last post by:
Hi All, I have a problem in finding control in a dynamically created updated panel. I have given the code below. Following is just a starting effort in a completely dynamic user control. I am...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.