8
New Era Technology Computer Training Calgary
        Home Contact Us
Home Schedule & Register Contact Us Class Feedback Course Outlines Class Calendar
New Era Technology Computer Training Calgary
New Era Technology Computer Training Calgary New Era Technology Computer Training Calgary New Era Technology Computer Training Calgary New Era Technology Computer Training Calgary
New Era Technology Computer Training Calgary
     
Search for Class search  
New Era Technology Computer Training Calgary New Era Technology Computer Training Calgary
New Era Technology Computer Training Calgary

New Era Technology Computer Training Calgary
Our Tips Newsletter

To stay informed with our new on-line Tips Newsletter.

New Era Technology Computer Training Calgary



New Era Technology Computer Training Calgary


New Era Technology Computer Training Calgary Weekly Tips

June 25 - July 1, 2007

Determining the control that last had focus (Access 97/2000/2002/2003)


There may be times when you want a VBA procedure to work with the control that last received focus. For example, when a user clicks on a command button, you want the button's Click event procedure to perform some action on whatever textbox control was previously selected. Fortunately, Access includes a property for this exact role--appropriately enough, it's named PreviousControl.
The PreviousControl property applies to the Screen object. To demonstrate, open a form that contains several controls in Design view. Add a command button and name it cmdLastFocus. Then, click the Code button to open the VBE. Add the following procedure:
Private Sub cmdLastFocus_Click()
  MsgBox Screen.PreviousControl.Name
End Sub
Switch back to Form view and select any of the controls. Then, click the cmdLastFocus button. The message box displays the correct control name regardless of which control had focus before clicking the button.


Drag and drop selections in place (Photoshop 6/7/CS)


To move something from one Photoshop document to another, you can copy and paste the selection. However, this copies the selection to the clipboard, which uses up a lot of RAM. Alternatively, you can drag an image, selection, or layer from one window to another using the Move tool. To center an image, selection, or layer, press the [shift] key as you drag it into the new document.


Create new event handlers to process control events (Visual Basic .NET)


Visual Basic .NET allows you to modify the default event handlers for a control to process any number of events from any control on the form. However, if you prefer, you can leave the default event handlers alone and create your own event handlers to process the events along with, or in lieu of, the original event handler. To illustrate a simple event handler, we added two buttons to a default Windows Application form. We then used the following code to create a new event handler:
Private Sub HandleAllClicks(ByVal sender As System.Object, ByVal e As _
  System.EventArgs) Handles Button1.Click, Button2.Click
    MsgBox("You Clicked " & CType(sender, Control).Name)
End Sub
This code creates a HandleAllClicks() event to process the Click() event for each button. It then displays the name of the control you clicked. It does so without affecting the existing Click() event subroutines for the buttons. If you wish, you can also place code in the default Click() events for the buttons and process the event twice. However, you’ll have no control over which event code .NET executes first.

Past Tips

Most Recent

June 25 - July 1

June 18 - 24

June 11 - 17

June 4 - 10

May 28 - June 3

May 21 - 27

May 14 - 20

May 7 - 13

April 30 - May 6

April 23 - 29

April 16 - 22

April 9 - 15

April 2 - 8

March 26 - April 1

March 19 - March 25

March 12 - 18

March 5 - 11

February 26 - March 4

February 19 - 25

February 12 - 18

February 5 - 11


Home Schedule & Register Contact Us Class Feedback


2005 New Era Technology All rights reserved.



New Era Technology
#300, 633 - 6th Ave S.W., Ford Tower
Calgary, Alberta
Canada T2P 2Y5

Office:(403) 265-1150
Fax: (403) 265-9797
Toll free phone: 1-877-385-3276

For information about Corporate Training
mailto:corporate@neweratechnology.com
(403) 265-1150