[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

CHANGING COLOR DURING ENTRY IN TEXT BOX

Posted on 1999-12-11
3
Medium Priority
?
142 Views
Last Modified: 2010-05-02
In text box iam getting input for 6 characters,
i want to set "RED" foreground color for first 2 characters while
typing and remaining "BLUE". How to do this ...
0
Comment
Question by:parthicaps
3 Comments
 

Expert Comment

by:nightliner
ID: 2274011
If you want text formatting you'll need the richedit control. With the standard text control you can't defenine color for each char. Or you'll have to do some tricking by placing two textboxes on eachother.
0
 
LVL 51

Expert Comment

by:Martin Liss
ID: 2274015
If you reject the above answer, I'll supply the code for using the RichTextBox that will do exactly waht you want.
0
 
LVL 1

Accepted Solution

by:
vbyuval earned 40 total points
ID: 2286739
You can add a PictureBox to your application , set the BackColor = vbWhite , add a CommandButton and write this code in the command :

Private Sub Command1_Click()

    Picture1.ForeColor = vbBlue
    Picture1.Print "he";
    Picture1.ForeColor = vbRed
    Picture1.Print "llo"


End Sub

This will write "he" in blue and "llo" in red .the ";" make it to be in same line .
                          Enjoy
                        Yuval Amir

0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month9 days, 10 hours left to enroll

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question