?
Solved

DrawText Selected?

Posted on 2003-03-01
8
Medium Priority
?
401 Views
Last Modified: 2012-08-14
Is it ppossible to use the DrawText function to draw text to appear selected or do I have to do this manually by filling the rectangle with the selected text color and then draw the text with the highlight color.
0
Comment
Question by:JohnMcCann
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 2

Expert Comment

by:JanusFury
ID: 8050659
the DrawState function can draw text in various states like it can with icons and bitmaps, I believe it can do a selected state for text.
0
 
LVL 5

Author Comment

by:JohnMcCann
ID: 8050705
I though the same thing but DrawState seems to be for drawing disabled text and images similar to GrayString
0
 
LVL 5

Author Comment

by:JohnMcCann
ID: 8050780
I have also tried DrawCaption
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 7

Expert Comment

by:webJose
ID: 8051180
I think it is not necessary as long as the backcolor and forecolor are correct.  Use SetBkColor and SetTextColor before drawing the text.  Assuming you are not drawing transparent text, the DrawText function should draw the text in a previously drawn rectangle, giving you what you are looking for.
0
 
LVL 5

Author Comment

by:JohnMcCann
ID: 8051720
Are you saying

SetBkColor
SetTextColor
CalcRect
FillRect
DrawText
SetBkColor
SetTextColor

That is what I am doing but would have liked to reduce that to one line.
0
 
LVL 7

Accepted Solution

by:
webJose earned 600 total points
ID: 8052087
Nope, I am saying:

SetBkColor
SetTextColor
DrawText
...

Try it.  I think that's enough.
0
 
LVL 5

Author Comment

by:JohnMcCann
ID: 8052185
Ok you missed setting the FontTransparent property to false.

But I've now got it working
0
 
LVL 5

Author Comment

by:JohnMcCann
ID: 8052187
Thankyou
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses

719 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