XTab's Blog

Ged Mead's Blog at vbCity

This blog hosted by:
http://blogs.vbcity.com      
  Home :: Syndication  :: Login

JulAugust 2006Sep
SMTWTFS
303112345
6789101112
13141516171819
20212223242526
272829303112
3456789

Archives

Topics

Ramblings

VB.NET

Saturday, August 05, 2006 #

  Sometimes these things are so obvious that it's almost embarrassing to even mention them.   But one thing I've learned since the beginning of the .NET era is that there is just so much to take in that even the really obvious things sometimes just aren't, well, obvious (at least not to me, anyway).

  Here's one that you probably sussed out ages ago but  I only found by chance while doing something else.

  You are in Design view and have a Windows Form on display.  You select a control or a component from the Toolbox, but then you realise you don't want it - you picked the wrong one, you changed your mind about using it, whatever.  

  But, like a clinging ex-girlfriend, that darned icon is just stuck like glue to the point where your mouse cursor is pointing.   You can't shake it off by clicking outside the form, selecting something in the Solution Explorer, clicking in the Error List box, passing it on to a mate ....   (Oops, wrong scenario; must have been thinking about the old girlfriends again!).

  You can't even fool it by clicking another window tab and looking at another form.  Well, you can, but when you eventually sneak back to the form you started with, guess what's still clung to the cursor? 

  Yep, that darn icon.
 
   So then I got to wondering why every Toolbox Tab has a "pointer" icon in it.....  and there you go -
you click on the Pointer and - oh, duh, you get a pointer.    Your unwanted, redundant, ready-to-drop-just-where-you-don't-want-it,  icon is replaced by a nice undemanding default pointer icon.   Job done.

--------------------------------------------------------

Afternote:    While fooling around with this, I also discovered that you can shake off the pesky icon by clicking on the Tab Name bar of any of the tabs in the Toolbox.  But I kinda like the Pointer icon now that I've discovered it.

posted @ 5:45 AM

 In earlier versions of Visual Studio .NET  if you created a User Control in a Class Library project and wanted to have a quick preview of the work so far, you might have been tempted to hit that F5 key to run the project.     Unfortunately if you did that you were then stopped short with a message …

“A Project with an output type of Class Library cannot be started directly”

  The usual fix is to add a second project to the solution, (a Windows Forms project), and use the default Form1 as the drawing surface to display the control.
It wasn’t that much of a problem, but it was yet one more thing you had to remember.

  Quite usefully in VS2005, you can now “Run” a User Control that you are developing in a Class library project.  Of course it doesn’t really run it as such, as it’s a DLL, but what does happen is that you are shown a rather nifty User Control Test Container.   The visual representation of your control  is shown in a panel on the left, with all the available properties listed down the right hand side of the display.  

   You still need to revert to the old method of adding a WinForms project if you need to test events or methods of the user control and it also only works for controls you are designing from the ground up.  That is, it doesn’t work for custom controls you are building by inheriting from one of the VB.NET standard controls.

     Still it’s quite a handy little feature when you are starting out with a User Control of your own design  and want to do a quick check of the visuals as you go.

posted @ 4:07 AM