473,394 Members | 1,195 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Word Wrap in CheckBox Text?

I know it's possible to wordwrap in a TextBox, but is it possible to do so in a CheckBox? This is a Win Mobile device, and the screen width is quite limited. I need the text wrapped, if longer than the width of the box, rather than truncated.

Is this possible, or am I going to have to create a custom object for this?
Dec 18 '08 #1
4 15432
221 Expert 100+
I don't know if it works the same for the compact framework but in standard winforms if you set the AutoSize property of the checkbox to False and reduce the width of the checkbox the text will wrap vertically in a similar fashion to the label.

Of course if you do that then it won't automatically resize to fit your text if you should change it, so you'd have to be careful or clever if you're implementing localization or if the text is dynamic in some way.
Dec 18 '08 #2
Thanks nukefusion. I looked all through the compact frameworks CheckBox object and couldn't find anything that would do any kind of autosizeing. The CF is way limited, compared to the standard toolset. I understand they have to save space on the mobile devices, but you'd figure with smart phones being able to switch between portrait and landscape, they'd see the need for this ability. I guess I'm going to have to create a custom object.

The best I can figure is to create an object that contains a CheckBox with no label and a TextBox for the lable. If I set the TextBox to multi line with wordwrap, I can resize it as needed.

Off to the drawing board...
Dec 18 '08 #3
I think We creat a string str = "line1 \n line2 \n line3 ...";
Then checkbox.text = str;
Jan 2 '09 #4
SaiLove, the CF checkbox does not have a multiline attribute. Anything after a newline is ignored and doesn't show in the textfield.

I got around this by creating my own custom control mentioned above. Right now, I'm trying to figure out how to resize the control when the vertical scrollbar is visible to prevent the horizontal scrollbar from being displayed.

This is a personal project I'm working that I've had to put on hold while developing a database app for the local Veterans Office
Jan 2 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Shawn Melton | last post by:
I have tried disabling the automatic word wrap feature in the text editor by going to: Tools/Options/Text Editor/Basic/General and Tools/Options/Text Editor/HTML/XML/General
by: Douglas G | last post by:
I've tried various ideas on this problem, but I don't see word wrapping. Can you point out what is wrong? It's a K&R exercise, and I'm still new to programming. Other pointers would be helpful...
by: Bernerd | last post by:
Would anyone out there tell me how to make my C# datagrid wrap the text in the cells. I haven't seen a good how to out there that does this. I know it has something to do with using styles but...
by: Jeff B. | last post by:
Has anyone come across a decent algorithm for implementing word wrap features in .net printing? I have a small component that uses basic printing techniques (i.e. e.Graphics.DrawString in a...
by: Jim Bancroft | last post by:
Hi everyone, This is a silly one I'm sure, but I'm having a whale of a time putting some text into my asp checkbox. Here's what I'd like to do: <asp:CheckBox runat="server"...
by: FUGATO | last post by:
I need to help to wrap up text. I have a line all the text and I need to wrap the text with 40 characters each line but without using function. Somebody help me about that and give me an idea
by: Joel Byrd | last post by:
I've got a div whose width is specified as a percentage so that if you shrink the browser window, the div shrinks, and the text inside the div wraps around to accommadate this. The problem is:...
by: Lorenzo Thurman | last post by:
I have a table cell that I want to wrap text inside of. I've tried both hard and soft wrap, but Firefox refuses to obey. IE 6&7 handle the wrap just fine. Does anyone know how I can fix this?
by: momo | last post by:
say i have the following table: <table width="500"> <tr> <td width="250">this is the text im concerned with</td> <td></td> </tr> </table> i need the width of the columns to STAY at 250 and...
by: zeroblade | last post by:
When I shorten shrink the width of my internet, window how do i make not the text of my website word wrap. The text is in a paragraph tag. Ex. This is the text in the sentence. If I...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.