Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 75493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:31:29+00:00 2026-05-10T20:31:29+00:00

Possible Duplicate: Watermarked Textbox for Compact Framework Using Visual Studio 2008 SP1, the latest

  • 0

Possible Duplicate:
Watermarked Textbox for Compact Framework

Using Visual Studio 2008 SP1, the latest Compact framework and Windows Mobile 5.

I need to use DrawString to put a string over a TextBox. But as soon as I draw the string the TextBox Control just over writes it. (I Know because I drew slightly off the edge of the control and my text is half visible (where is is off the control) and half gone (where it is on the control.)

Is there anyway I can get the TextBox to not refresh so I can keep my text there?

NOTE: I have looked into subclassing TextBox and just having it paint my text. However, Paint events for the TextBox class are not catchable in the CompactFramework. If you know a way to be able to paint on the TextBox without the Paint events then I would love to subclass the TextBox class.

–End of Question–

Just in case you are wondering why I need to do this, here is what I am working on: I need to have a text box where a numeric value must be entered twice. I need some sort of clear clue that they have to enter the number again. I would like to have a slightly grayed out text appear over the text box telling the user to re-enter.

I have tried using a label, a hyperlink label and another text box, but they obscure the text below (which has a default value that has to be partially visible).

If anyone knows a different way cue for re-entry that would be great too!

Vacano

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:31:30+00:00Added an answer on May 10, 2026 at 8:31 pm

    You can solve this problem in a different fashion. It sounds like you want to silhouette their previous input so they must type it again.

    I don’t know what strides the CF has made recently but if there is a RichTextBox then this method will work. If not you would have to write your own implementation starting with a base control.

    1. Set the text of the RichTextBox to the silhouette value but make the text color gray for all the characters.
    2. Capture the keypress events and as they press the correct key, change the text color for that character pressed from gray to black and discard that key press, and discard all other key presses.

    This solution won’t work if you want to allow them to go off the reservation, such as freeform text. Instead of discarding what they typed if they mistype or enter a different character you would not discard the keypress, but blank out the current and remaining gray characters thus allowing them to type with no silhouette.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 98k
  • Answers 98k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The find_if function expects an object which is callable as… May 11, 2026 at 7:37 pm
  • Editorial Team
    Editorial Team added an answer I'd have to recommend storing all your times in UTC,… May 11, 2026 at 7:37 pm
  • Editorial Team
    Editorial Team added an answer VB and C# have different interpretations of what "protected" means.… May 11, 2026 at 7:37 pm

Related Questions

Possible Duplicate: Why not use tables for layout in HTML? Under what conditions should
Possible Duplicate: NAnt or MSBuild, which one to choose and when? What is the
Possible Duplicate: How do I calculate someone's age in C#? Maybe this could be
Possible Duplicate: .NET - What’s the best way to implement a catch all exceptions

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.