473,788 Members | 2,897 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Word Wrap in CheckBox Text?

12 New Member
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 15466
nukefusion
221 Recognized Expert New Member
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
bjwest
12 New Member
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
SaiLove
1 New Member
I think We creat a string str = "line1 \n line2 \n line3 ...";
Then checkbox.text = str;
Jan 2 '09 #4
bjwest
12 New Member
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

0
1133
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
10
2337
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 too. #include "header.h" /* does the wordwrapping */ void fold(char buffer, int len) {
1
3541
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 haven't got styles to work right yet with my grid that get's dynamically populated by xml files. Here's my code that gets the grid. private void mnuContacts_Click(object sender, System.EventArgs e) {
10
23324
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 PrintPage event of a PrintDocument object) to send some formatted text to the printer. However, if the lines are too long they run off the page rather than wrapping around. I'm sure I can spend the time and come up with a word wrapping algorithm but...
3
3615
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" Text='<%#DataBinder.Eval(Container.DataItem, "OptionLabel")%> Fields' ID="chkDBFields"/> ....unfortunately, it doesn't work. The DataBinder text is evaluated literally, so all I get on-screen is the word "Fields". And whenever I try
3
480
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
9
9647
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: if I put a really long word (like a web address) in the div, then it props the rest of the text open to the width of the word, and the text can't wrap past that width; but if I shrink the browser window, the div also shrinks and so the net result...
10
72703
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?
5
6743
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 wrap text that is longer
5
16673
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 decreased the width of my window how would I get it so that then I would only see part of the sentence instead of it word wrapping to: This is the text in the sentence.
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10113
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5402
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2896
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.