Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Trick 80

Status
Not open for further replies.
Hi

Does anyone knows whats the short key to Navigate between Design Window and Code Window???

Thanks

Gazal
 
F7 = Code window.
Shift + F7 = Design window.
 
Hypetia - how the heck did you find that out ?
 
Try reading the View pull-down menu, where a lot of these shortcuts are shown!

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Also, choose View>Toolbar>Customize command to bring the Customize dialog. Choose the Options tab and choose Show shortcut keys in ScreenTips checkbox. Click the Close button.

From now on, whenever you hower your mouse pointer over a toolbar button, the shortcut key to that command (if any) will also be displayed along with its name in the tooltip. This is a very handy way to know and learn keyboard shortcuts.

Note that in addition to Visual Basic, this useful function also works in all office applications as well as the Visual Basic Editor integrated in those applicatons.
 
Wow theres alot i have learned from this forum!

Another keystroke is alt + shift + tab
then let go

do this to cycle through apps in stead of switching between two apps

-kd7yen

Nothing like duct tape
Tapemonster your source for any kind of tape
 
>Another keystroke is alt + shift + tab

isnt that the same as holding alt and tabbing?

If somethings hard to do, its not worth doing - Homer Simpson
 
Not quite. <SHIFT> changes the direction the apps are looped through. This is a standard modifier for the action of the <TAB> key.
 
ahh.. i hadnt realised.. but i did only have 2 apps open :)

If somethings hard to do, its not worth doing - Homer Simpson
 
My God, please don't tell me that you have been typing out long variable names for eight years!

Don't tell the boss your 'new' trick, he/she'll just want your projects done quicker.

:)
 
OK - not VB exactly, but one of my favorites...

In the right pane of an 'explore' window (or the only pane of an 'open' window) in Windows Explorer (in details view), how many times have you grabbed the dividing lines in the gray bar at the top of the columns and re-sized the columns to keep names, sizes, etc. from being truncated with '...' or taking up too much room?

Put the focus in that pane and hit Ctrl and the 'gray Plus' key (the '+' key on the numeric keypad) and all the columns will re-size automagically.

Even works in Open, Save-as, etc. dialogs (which are just little inherited explorer windows) when in 'details' view.

This is so handy, I've learned to put up with the blue "func" key on my laptop, and hit Ctrl-Func-<semicolon> (the <semicolon> key has the little blue '+' on the front of it in the awkward laptop-style "numeric keypad" remapped onto the fronts of keys in the middle of the keyboard).

- Chuck Somerville
 
that ctrl and "+" also works in report-mode listviews in my VB app. Now I gotta charge the customer extra for that added functionality! :)

bdiamond
 
Here's one that I ran across. If you want to force the user to use only numerics, upper or lower case characters in a textbox try this:

Private Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal _
dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Const GWL_STYLE = (-16)
Private Const ES_UPPERCASE As Long = &H8&
Private Const ES_LOWERCASE As Long = &H10&
Private Const ES_NUMBER As Long = &H2000

Private Sub Form_Load()
Dim DefStyle As Long
DefStyle = GetWindowLong(Text1.hwnd, GWL_STYLE)
Call SetWindowLong(Text1.hwnd, GWL_STYLE, DefStyle Or ES_NUMBER)
End Sub

&quot;Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.&quot;
 
I remember that I also mentioned the Ctrl+[Num+] shortcut in thread222-570674, a long time ago.

DrJavaJoe, ES_NUMBER style works well but does not prevent you from pasting non-numeric data from clipboard. However the lower- and upper-case styles are just fine.

Here is one of my favourite shortcuts that apply to a treeview structure.

Select any node in any treeview. Press * key on the numpad. It will cause the selected node to expand itself as well as its all children nodes to show the entire tree structure under that node.

Also, most of us know that Alt+[Space] shows control menu of the active window. Pressing Alt+[-] shows the control menu of the active child window in an MDI application.
Similarly, Alt+F4 closes the active Window, Ctrl+F4 closes the active child window in an MDI application.

Print Screen key takes the snapshot of the whole desktop and places it on the clipboard. Alt+[Print Screen] takes the snapshot of the active window only, not the entire desktop.

Last but not least, you can use Ctrl+W to close any (Internet or Windows) explorer window.

Hope this thread will grow further...
 
I can remember starting with VB (v2) and every time I got into a loop (lots of times with the app I was writing) I would have to kill VB to get out of it (and lose work if I hadn't saved).

Wasn't until I worked with other people I found out about ctrl-break.

No matter how expert you are you can probably learn something from any novice.


======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
yeah Ctrl-Break is a life saver...
(2nd place to ctrl-alt-del in my book)

and it has been caried over all the way from GWBasic (BasicA, etc...) which was the OLD dos version where you had Line numbers, and you used hot keys (F1-F10) at the bottom of the screen to save / load etc...

you had to type like save"myfile.bas" to get it to save and load"myfile.bas" to load it.

There was no such thing as a dialog box back then.

And to make matters worse the source code was saved in binary files.

Use list to view your code...
Like if you had a program with 1000 lines of code and wanted to view lines 10 - 30 you had to say:

List 10-30

And there was only one direction to scroll... Down.
And that was done involuntarily for you ;)

and you wrote your program on the same screen you ran it on...

you effectivly wrote the entire program in the equivalent of todays immediate window and had to use CLS to clear the screen...

It's crazy how far VB as well as languages and editors in general have come...

And thank god (most of) the old ones are obsolete ;-)

Have Fun, Be Young... Code BASIC
-Josh
cubee101.gif


PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
Back on May 4, 2003 SemperFiDownUnda wrote:

Quote .....

"On that they used to have in VB that I haven't been able to relocate, if it still exists.
There used to be a hot key ....ooops I think I'm thinking of Visual C++, anyway.....a hot key where you would be on on a block start or end and it would find the other side....
ie put your cursor on a If and it would jump to the End If or a Do and it would jump to the Loop
It was good for finding out where you missed a end if when you do sloppy code with 10 levels in 1 procedure 8P"

..... Unquote

Does any one know if this exists in VB6, I looked though the MSDN - no joy.

Thanks. This is a great thread,

&quot;Life is full of learning, and then there is wisdom&quot;
 
Glowworm27, it says this thread was idle for 11 months untill you posted! Is this true? I'm just wondering because I remember reading it a while ago but no where near 11 months and people were still posting...

Anyway, thanks for digging it up. I learned so many new shortcuts!
 
I am an amateur and easily impressed. I don't think I saw these. Excuse if they are common knowledge.

In the IDE a control is highlighted and you want to change a property, let’s say "Caption":
Press “Ctrl Shift C” >> the property window will appear, if hidden, and the first "C" item will be selected/ highlighted. If there are several c-properties; press “C” again to scroll through to the next.

If in IDE & beginning a new project - Set the Form Font characteristics first. Now when you introduce a control they will all have those Font characteristics. Change those of the Form last if needed.

You’re in IDE designing a form and need to place several textbox (etc.) controls- You can click away and wind up with a heap or.. Press Ctrl Txtbox on the Tool Bar.. Then left click on the Form (where you want the controls’ upper left corner to begin) and drag right. Need not hold Ctrl Key while doing this. Continue click & drag until you are finished adding the text boxes. . When finished press Esc or click the pointer on the TB.






 
csomervi said:
Put the focus in that pane and hit Ctrl and the 'gray Plus' key (the '+' key on the numeric keypad) and all the columns will re-size automagically.

Thanks!

• Windows-Break brings up the System Control Panel.

• Ctrl-Tab (and Ctrl-Shift-Tab) is 'smaller' than Alt-Tab and Ctrl-F6. It generally switches between tabs on a form or between documents in some MDI apps such as Excel. (And I'd like to throttle the people at Microsoft who changed Word to an SDI app... which broke Ctrl-Tab.)

• If you like shortcuts, put them on your favorite applications in the Start Menu. They generally are in the format Ctrl-Alt-Letter. It's much faster to hit, say, Ctrl-Alt-W to launch MS Word than it is to find it in the Start Menu or even on the QuickLaunch toolbar.

• F11 in Internet Explorer toggles full-screen view.

• I run with the taskbar auto-hiding because I covet my screen space. To make it pop up, hit Ctrl-Esc or the Windows key. Press Esc by itself to get out of the Start Menu but leave the taskbar selected. You can then use Tab and the cursor keys to move through Quicklaunch, application list, system tray, and desktop. Spacebar activates the selection. Very useful if your mouse fails and you need to fix it or finish up something before restarting. Alt-Tab to get back to your current app. Note: you can work with items on the desktop even when you can't see them! Use space, arrow keys, and the context-menu key. Type the first letter or letters of something to move to it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top