I recent was spinning out a quick Windows Form application to help an orders team look up product information and found myself questioning how to wrap text in a label rather than have it venturing off the application into nowheresville.
As a web developer, I always assume my text will find its place within the boundaries of a panel or table cell, whatever medium houses it. But the same should not be assumed for Windows Forms applications. Luckily, there is a simple solution.
Set the label's AutoSize property to Off.
The label becomes a resizable control that you can drag to whatever limits you want the text contained within.
Showing posts with label Windows Forms. Show all posts
Showing posts with label Windows Forms. Show all posts
Friday, August 20, 2010
Thursday, July 1, 2010
If your VB.NET Application won't run on Windows 7
Despite being primarily a web developer, every now and then at my office, I need to create small little Windows Form based applications that perform one or two simple tasks to help out the every day processes of the staff.
Recently a couple people at our office were upgraded to Windows 7, and have experienced issues with those Visual Studio 2008 based applications, either during installation or running them after installing.
After some investigation, I stumbled upon the cause of the problem and a solution. Whether it is the machine or the operating system or gremlins sneaking around in this guy's new computer; for some reason, code compiled to work with the Target CPU value "AnyCPU" won't run on this machine.
To correct the issue, I opened the project settings in Visual Studio and clicked through to the Advanced Compiler Settings:
Project -> Compile -> Advanced Compile Options
Change the "Target CPU" field to "x86" and click OK.
Publish your application and it should install and run on the Windows 7 computer now.
Recently a couple people at our office were upgraded to Windows 7, and have experienced issues with those Visual Studio 2008 based applications, either during installation or running them after installing.
After some investigation, I stumbled upon the cause of the problem and a solution. Whether it is the machine or the operating system or gremlins sneaking around in this guy's new computer; for some reason, code compiled to work with the Target CPU value "AnyCPU" won't run on this machine.
To correct the issue, I opened the project settings in Visual Studio and clicked through to the Advanced Compiler Settings:
Project -> Compile -> Advanced Compile Options
Change the "Target CPU" field to "x86" and click OK.
Publish your application and it should install and run on the Windows 7 computer now.

Labels:
Compile,
Project,
Target CPU,
vb.net,
Visual Studio 2008,
Windows 7,
Windows Forms