A Little More Progress
Well, I have gotten a little farther with the toolbar program (Nevada). I have it drawing multiple icons (I had to correct a problem in the coe to make that work — namely I had to specify an accurate size for each PictureBox control — otherwise after the first one it was drawing them with 0 sizes or something). I also have it doing the mouse over effects I wanted with the enlarging icons as well as a bevel when the icon is clicked on (essentially non-selectable buttons). Why all the manual work? Because a true toolbar can not have its buttons actually gaining focus like a regular button does.

This all seems to work pretty reliable so I am pretty happy with the results. My next order of business was getting the screen setup better for skinning. Although the screenshot doesn’t obviously show it, underneath, the window is split up into 5 different panels. Each panel as an image for a background. The icons live within the “panelMain” and are added to it dynamically. When a mouse up event is detected on an icon that has had just received a mousedown event, it actually launches the associated program. So in the example above, after releasing the mouse button on top of the notepad icon it will launch notepad. To make life a little easier, I associated the PictureBox.Tag property for each dynamically created picture box with the actual FileBarItem object that created it. Then to launch the program I just have to cast a temporary BarItem object when the UI determines the item is needing to be “executed”. Since all BarItem objects have an .ExecuteItem method, I just call that and for FileBarItems that means that it will execute the file specified. Execution for now is handled by a single line call to System.Diagnostics.Process.Start(itemfilename). Why they decided to put process in a library called “Diagnostics” is beyond me.
No comments yet. Be the first.
Leave a reply