DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 16 Aug 2007 17:58:34 -0700,    posted on: microsoft.public.dotnet.framework.compactframework        back       

Thread Index
  1    rparrella


TextBox with custom OnPaint   
I am trying to write a TextBox control (C#) which displays text which is the 
exact Height of the text box (No space above and below) This control would 
support uppercase characters only (ones that do no drop below the baseline) 

The CF seems to automaticallty adjust the Height of the TextBox when the 
Font is set and this automatically includes space above and below the text. 
The PreferredHeight property is not supported by Compact Framework.

I have tried to create a TextBox derived class which can override OnPaint. 
This does not seem to be possible because any call to GetGraphics from with 
the TextBox code, throws an exception.

Secondly I tried to write my own TextBox class derived directly from Control 
(instead of TextBox or TextBox base). In this case I can implement OnPaint, 
but it is unacceptable becuase I can not accurately place the caret. When I 
attempt to place the caret, I use MeasureString, but this does not seem to 
measure accurately enough to place the caret exactly where it belongs. (It is 
always a little to far to the right)

Aside from my problem with the caret my control works as I would like.

Any ideas on how this can be accomplished?? Has anyone written such a 
TextBox with CF 2.0?
Date:Thu, 16 Aug 2007 17:58:34 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us