Monthly Archives: April 2010

How to insert that ampersand into a label (WinForms)

This was a rough morning, all right! Especially since it was so difficult to insert an ampersand (&) in that freakin’ label!

So the problem is that & is used for the mnemonic function (you know… in case you want the File menu to pop up when you press the ‘F’ key on your keyboard, you would name the File menu as ‘&File’).

untitled4

Therefore, having a label text called ‘a&b’ would require:

1. disable the menmonic function: UseMnemonic = False

2. change the label’s text to a&&b

untitled5

I admit it’s kind of lame to have a post about this, but you just might wonder one day why your label isn’t listening 🙂

This was frustrating…

Sometimes, just sometimes, it’s very frustrating to search for something that isn’t there, isn’t it? 🙂

I was trying to make a tutorial on how to use the built-in setup and deployment system that VS05 offers in the form of Setup and Deployment projects, and the result was that I was ‘hanging’ at the customization part, specifically at changing things like the ‘default company name’ tag. Why is was so difficult? Well, basically, because it just wasn’t there.

After googling around, I even found out that the tags can be changed using some key inside the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion, but this is totally unacceptable, of course (to be honest, I didn’t even succeed in that method either).

So I’ve been looking and looking for about 1 hour for those impossible-to-find tags, when I finally decide to dock the Properties windows and surprise: there they are.

Take it like this: right-click-ing the Setup project created inside the solution brings you to the Setup Property Pages windows, which contains a set of completely different properties than the ones listed in the Properties toolbox. This is frustrating and confusing, since almost everything in VS works different: right click-ing a component in Solution Explorer toolbox (or even Catalog Item toolbox) will either pop the Properties toolbox or pop a windows with the mostly the same properties listed in the Properties toolbox…

So, whenever you are looking for changing the default tags from a setup project, remember to check the one and only: PROPERTIES TOOLBOX. 🙂

Alex 🙂

coming up next: how to create an installer with a professional feeling, sparing the $1000+ required for InstallShield or InstallWise.