Jump to content
  • Advertisement
Sign in to follow this  
Boltimus

Of sticks and Carets...

This topic is 4640 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do I shrink the size of the Caret in an Edit control? I can do everything with the control but control that darn caret. Right now my window is small, 8 pixels in height, but the caret is huge, like 30 pixels. The only thing that comes tom mine would be to subclass the window and interupt part of the painting process, or perhpas try to check for the painting of the edit control in the main window proc by checking the hwnd of the edit contrl against the hwnd returned in the win proc. Thx! Bolt

Share this post


Link to post
Share on other sites
Advertisement
Okay, basically I create an Edit control where the user can input some numbers. The edit window is very small in height, only 8 pixels. The thing is, when a user clicks in the edit field to enter numbers the caret is huge, like 20 pixels high. So it extends out of the edit area and onto the main window. What I'm trying to do is find a way to shrink the size of the caret so that it fits inside of the edit control instead of "spilling" over the edges of the control onto the main window...

Hope this helps clear things up

Share this post


Link to post
Share on other sites
I assume you're developing in Windows with tradition Win32 programming style. To create a caret, you invoke CreateCaret () API function and supply the caret width:
BOOL CreateCaret(HWND hWnd, HBITMAP hBitmap, int nWidth, int nHeight);

If nWidth == 0 it takes the default system's caret attributes. To get system's caret settings, you call SystemParametersInfo () with SPI_GETCARETWIDTH. You may look up MSDN for details.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!