Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 149,915 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 2,171 people online right now. Registration is fast and FREE... Join Now!




Key Macros

 
Reply to this topicStart new topic

Key Macros

zargon05
31 Dec, 2007 - 11:24 PM
Post #1

New D.I.C Head
*

Joined: 31 Dec, 2007
Posts: 1

I want to make a program in visual basic 2005 express edition to read a key combination from user and make it display a text or string. I want this to be usable like in in-game chat for messanger chat.
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Key Macros
31 Dec, 2007 - 11:33 PM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,655



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
Well the event you are going to want to checkout is the KeyDown event of a control. This event has a parameter called "e" which is passed to it when the user presses a key or a series of keys. You can use the properties "keycode", "keydata", "keyvalue", and "modifiers" to determine the keys pressed on the control. With the combination of these properties with the modifiers property you can determine key combinations like the shift or alt keys etc.

In this event you can detect the keys pressed and simply modify controls with whatever content you want to display for that key. Like inserting a happy face image when they type ":)"

For more information about the event and how to use its properties, you can check out this MSDN page...

Control.KeyDown Event - MSDN

Hope that is what you were looking to do. Enjoy!
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Key Macros
1 Jan, 2008 - 11:03 AM
Post #3

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Visual Basic 2005 Express is VB.Net so I am moving this to the correct forum. But my 2 cents, as Martyr2 stated you can use the KeyDown event but you can also check out the

They all have their pro's and con's, and at times one will work when others wont, depending on what they're being used for.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 02:14PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month