Vincent Leung .NET Tech Clips

The latest tech clips from the .NET community

Extending ASP.NET DataPager: Creating a google analytics ASP.NET data pager. Free source code and programming help

image 

CodeProject: Extending ASP.NET DataPager: Creating a google analytics ASP.NET data pager. Free source code and programming help

April 28, 2008 Posted by | ASP.NET | Leave a Comment

CodeProject: Hiding the Taskbar and Startmenu (start orb) in Windows Vista.

 

Via Hiding the Taskbar and Startmenu (start orb) in Windows Vista.

April 28, 2008 Posted by | Tools | Leave a Comment

Keith Brown Password Minder

image 

Via Pluralsight – Premier Microsoft .NET Training: Tools

April 28, 2008 Posted by | Tools | Leave a Comment

Consolas Font Pack Download from Microsoft

 

Download details: Consolas Font Pack

April 27, 2008 Posted by | Uncategorized | Leave a Comment

Processing Global Windows Mouse and Keyboard Hooks in C#

 

Processing Global Windows Mouse and Keyboard Hooks in C#

By George Mamaladze


This class allows you to tap Window keyboard and mouse and/or to detect their activity even when an application runs in the background or does not have any user interface at all.

Introduction

This class allows you to tap keyboard and mouse and/or to detect their activity even when an application runs in the background or does not have any user interface at all. This class raises common .NET events with KeyEventArgs and MouseEventArgs, so you can easily retrieve any information you need.

Using the code

To use this class in your application, you need just to create an instance of it and hang on events you would like to process. Hooks are automatically installed when the object is created, but you can stop and start listening using appropriate public methods.

UserActivityHook actHook;
void MainFormLoad(object sender, System.EventArgs e)
{
    actHook= new UserActivityHook(); // crate an instance
    // hang on events
    actHook.OnMouseActivity+=new MouseEventHandler(MouseMoved);
    actHook.KeyDown+=new KeyEventHandler(MyKeyDown);
    actHook.KeyPress+=new KeyPressEventHandler(MyKeyPress);
    actHook.KeyUp+=new KeyEventHandler(MyKeyUp);
}

Now, an example of how to process an event:

public void MouseMoved(object sender, MouseEventArgs e)
{
    labelMousePosition.Text=String.Format("x={0}  y={1}", e.X, e.Y);
    if (e.Clicks>0) LogWrite("MouseButton     - " + e.Button.ToString());
}

+ Don’t forget to read the comment sections

CodeProject: Processing Global Mouse and Keyboard Hooks in C#. Free source code and programming help

April 19, 2008 Posted by | Libraries | 1 Comment

CSS shorthand properties

 image

image

 image

image 

CSS shorthand properties

April 17, 2008 Posted by | Design | Leave a Comment

Excellent CSS Tutorials on Selectors, Lists & Floats

 

image

Via css.maxdesign.com.au – CSS resources and tutorials for web designers and web developers

April 17, 2008 Posted by | Design | Leave a Comment

Learn CSS Positioning in Ten Steps: position static relative absolute float

 image

Via Learn CSS Positioning in Ten Steps: position static relative absolute float

Also, CSS Positioning & the Box Model

image

Via  BrainJar.com: CSS Positioning

April 17, 2008 Posted by | Design | 1 Comment

Application-wide Wait Cursor – Automatically Shows when App is busy

 

From a developer’s point of view, using the WaitCursor library could not get any simpler. Add a reference to the WaitCursor assembly and then add the following line to your application start-up code:

ApplicationWaitCursor.Cursor = Cursors.WaitCursor;

That’s it!

You can of course use any Cursor you like, you can use one of the predefined Cursors or you can create a new cursor and use that instead. You can also fine tune the amount of work time that will elapse before the Cursor is shown:

ApplicationWaitCursor.Delay = 
             new TimeSpan(0, 0, 0, 1, 0);  // Delay of 1 second

CodeProject: Automatic Application Wait Cursor. Free source code and programming help

April 8, 2008 Posted by | .NET, Libraries | 1 Comment

SplitButton: an XP style dropdown split button.

 

image

If you like to have it “Auto Dropdown” whenever you are hover above the Main Button,

try add the following to the original code:

// Overrided this Method to support “Auto Dropdown”
protected override void OnMouseEnter(EventArgs e)
{
    if (_AlwaysDropDown || MouseInSplit())
    {
        if (Enabled)
        {
            SetSplit(_ClickedImage);

            if (this.ContextMenuStrip != null && this.ContextMenuStrip.Items.Count > 0)
            {
                this.ContextMenuStrip.Show(this, new Point(0, Height));
            }
        }
    }
    else
    {
        if (Enabled)
        {
            SetSplit(_NormalImage);
        }
    }

    base.OnMouseEnter(e);
}

 

Via CodeProject: SplitButton: an XP style dropdown split button. Free source code and programming help

April 7, 2008 Posted by | .NET, WinForm | Leave a Comment

Follow

Get every new post delivered to your Inbox.