Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Knowledge Base > Code Library > Two controls for the (free) price of one


Reply
 
Thread Tools Display Modes
  #1  
Old 11-06-2001, 12:15 PM
Merrion's Avatar
Merrion Merrion is offline
Ultimate Contributor

* Guru *
 
Join Date: Sep 2001
Location: Dublin, Ireland
Posts: 1,828
Default Two controls for the (free) price of one


The VBEventWindow control which adds a large number of new events to a Visual Basic form, such as Move when the form is moved, ActiveApplicationChanged when the user switches to or from your application and a large bunch more.

VBSysTrayCtl which uses RegisterWindowMessage to get around th eproblem of having to piggyback an existing message to allow you to add an icon to the system tray and interact with it.

I'd be interested in your comments on both - in particular, what extra events should be added to the first?



Reply With Quote
  #2  
Old 11-06-2001, 12:43 PM
Mill Mill is offline
Just another Excel nerd

Retired Moderator
* Guru *
 
Join Date: Feb 2000
Location: Michigan, USA
Posts: 2,631
Default Re: Two controls for the (free) price of one

I don't have time to check into these now, but the first one looks like one that I'd probably find pretty useful.

As for the system tray, did you know that VB already includes a SysTray control/project on the MSDN CD's?
__________________
"The face of a child can say it all, especially the mouth part of the face." - Jack Handey
Reply With Quote
  #3  
Old 11-06-2001, 12:53 PM
ChiefRedBull's Avatar
ChiefRedBull ChiefRedBull is offline
ISearchGoogle

Retired Moderator
* Expert *
 
Join Date: May 2001
Location: england
Posts: 6,321
Default Re: Two controls for the (free) price of one

These and the others you advertised are very nice Merrion - but I think we'd all appreciate source code for all of them. You included it for the image map - which is great, cos ive been struggling to write one of them for a while, and will look forward to reading it, but can we have it for the rest as well??

Chief
__________________
Chuck Norris ordered a Big Mac at Burger King, and got one.
Reply With Quote
  #4  
Old 11-06-2001, 12:55 PM
Thinker Thinker is offline
Iron-Fisted Programmer

Retired Moderator
* Guru *
 
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
Default Re: Two controls for the (free) price of one

Chief, did you look in the attachment? I downloaded it and it looks like
source to me.
__________________
Posting Guidelines
Reply With Quote
  #5  
Old 11-06-2001, 01:58 PM
ChiefRedBull's Avatar
ChiefRedBull ChiefRedBull is offline
ISearchGoogle

Retired Moderator
* Expert *
 
Join Date: May 2001
Location: england
Posts: 6,321
Default Re: Two controls for the (free) price of one

I didn't no..... apologies Merrion.

Chief
__________________
Chuck Norris ordered a Big Mac at Burger King, and got one.
Reply With Quote
  #6  
Old 11-07-2001, 05:05 AM
Merrion's Avatar
Merrion Merrion is offline
Ultimate Contributor

* Guru *
 
Join Date: Sep 2001
Location: Dublin, Ireland
Posts: 1,828
Default Re: Two controls for the (free) price of one

A bit more documentation:

VBEventWindow Events

Public Event ActiveApplicationChanged(ByVal ActivatingThisApp As Boolean, ByVal hThread As Long, Cancel As Boolean)
This is fired when the user is switching to or from your application.


Public Event LostCapture(ByVal hwndNewCapture As Long, Cancel As Boolean)
This is fired when the focus switches to another window in your application's thread...for example in an MDI app when you switch between child forms.

Public Event KeyPressed(ByVal VKey As Long, ByVal Repetition As Long, ByVal scanCode As Long, ByVal ExtendedKey As Boolean, ByVal AltDown As Boolean, ByVal AlreadyDown As Boolean, ByVal BeingPressed As Boolean, Cancel As Boolean)
Occurs when a key is pressed while your window has the focus. This is similar to Form_Keypress.

Public Event LowMemory(ByVal TimeSpentCompacting As Long)
This is triggered when the system is having to free up any available memory because it is running low.

Public Event Move(ByVal x As Long, ByVal y As Long, Cancel As Boolean)
This event occurs when the user moves your form (bit of an ommision by MS in my opinion)

Public Event VerticalScroll(ByVal Message As enScrollMessages, ByVal Position As Long, Cancel As Boolean)

Public Event HorizontalScroll(ByVal Message As enScrollMessages, ByVal Position As Long, Cancel As Boolean)


Public Event WindowsSettingsChanged(ByVal NewSetting As enSystemParametersInfo)

Public Event WindowsINIChanged(ByVal Section As String)

Public Event NonClientMouseMove(ByVal Location As enHitTestResult, ByVal x As Single, ByVal y As Single)
Public Event NonClientMouseDown(ByVal Location As enHitTestResult, ByVal Button As Integer, ByVal x As Single, ByVal y As Single)
Public Event NonClientMouseUp(ByVal Location As enHitTestResult, ByVal Button As Integer, ByVal x As Single, ByVal y As Single)
Public Event NonClientDblClick(ByVal Location As enHitTestResult, ByVal Button As Integer, ByVal x As Single, ByVal y As Single)
These provide mouse messages for the non-client area of your Visual basic form

Public Event MinMaxSize(MaxHeight As Long, MaxWidth As Long, MaxPositionTop As Long, MaxPositionLeft As Long, MinTrackWidth As Long, MinTrackheight As Long, MaxTrackWidth As Long, MaxTrackHeight As Long)
This event is fired when windows wants to resize your form, in response to the user clicking on maximise, moving the form or drag-resizing your form. By altering the parameters in you can get tight control over where your form can and cant be moved/resized to.

[/i]Public Event MouseOverMenu(ByVal Caption As String)[/i]
This is fired when the mouse moves over a top level menu. You can use this event to update the context sensitive help or status bar, for example.

Public Event WindowMessageFired(ByVal msg As WindowMessages, ByVal wParam As Long, ByVal lParam As Long, Cancel As Boolean, ProcRet As Long)
This is fired for all the other windows messages - basically it is a subclasser.

HTH,
Duncan
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->