473,657 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Enter, Shift, and Arrow Keys to control Size and Posistion of a shape

3 New Member
Hi

I need to know how, if even possible, to enable the user of my program to control the Size and Posisiton of the circle I have Drawn on the form by using the Enter Key (to increase size), Shift Key (to decrease size), and Arrow Keys (to alter posistion of circle on screen).

My program consists of a single form with six command buttons and a circle that I drew with the shape control. For each of the command buttons I have written a click prcedure so that the user can control the size and posistion of the shape by clicking buttons.

I need to alter this program so that the user can use key strokes instead of mouse clicks to control size and posistion. I also need any command buttons on the form to be invisable to the user so that only the Circle is present in their view.

I have tried for hours to accomplish this and have failed. Please Help!
Sep 27 '06 #1
1 2017
CaptainD
135 New Member
Sounds like a homework assignment.

Look into keypress events (Keyup, keydown) Each key has it's own KeyAscii or keycode value assigned to it. This example will show you the key code each time you let off a key that was pressed.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
  2. 'You can use this to alter the size of your object or any other code you want to run
  3.       MsgBox KeyCode, VBOkOnly, "Key Code Value"
  4. End Sub
  5.  
Sep 27 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

52
5868
by: Dick Moores | last post by:
I need to figure out how to compute pi to base 12, to as many digits as possible. I found this reference, <http://mathworld.wolfram.com/Base.html>, but I really don't understand it well enough. Could someone show me how to do what I need? Thanks, Dick Moores rdm@rcblue.com
5
18210
by: skipc | last post by:
Hi, I am stuck... I've got a popup window that displays a list in table format with links on the bottom to navigate the list <prev> 1 2 3 ... <next> When I demo'd to the users... they immediately asked if they could use the arrow keys and enter key to navigate the list. I think there must be a way to do this, but I can't figure it out.
7
5768
by: Seash | last post by:
Hi friends , here is the sample code private void txtbox_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if(e.KeyChar == 13) //enter { txtbox2.Focus(); }
0
1459
by: Gene Hubert | last post by:
I've got this working but I've got to wonder if there's not a better way. I'm capturing the tab and shift-tab keys in a datagrid and doing custom processing. Also, the form designer gets weird when I put in the line: Me.FileList = New FileListDataGrid(AddressOf HandleTabKey, _ AddressOf HandleShiftTabKey)
6
3302
by: Bruce D | last post by:
I have a datagrid (uggg) that I use and create the columns programmatically...see below. objCol = New DataGridTextBoxColumn objCol.MappingName = "amount" objCol.HeaderText = "Amount" objCol.Width = 60 objCol.Format = "C" objDGTS.GridColumnStyles.Add(objCol) ' create keypress, validating events for this textbox column only Dim dgtb As DataGridTextBox = CType(objCol.TextBox, DataGridTextBox)
1
10141
by: Martijn Mulder | last post by:
/* I have problems detecting the Arrow Keys on a User Control. A control derived from System.Windows.Forms.Control neglects 'bare' Arrow Keys but does react on the combination <Altor <Ctrl+ Arrow Key. The code below shows what I mean. How can I cure this? (excuse me for the line breaks) */
0
2915
by: Martijn Mulder | last post by:
/* I override IsInputKey() to direct the Arrow Keys (Cursor Keys) to my custom System.Windows.Forms.Control. But, holding down the Shift-Key prevents the Arrow Keys from coming through. How can I intercept the Arrow Keys when holding down the Shift Key? */
3
2287
by: GS | last post by:
If I were to capture enter key on keyup event of an GUI object like comboBox box, How do I avoid killing ctrol-c, controlv, controlx, shift-insert, shiftdelete, contrl-insert
1
1671
by: darkjemz | last post by:
whats wrong with this?? plz help me!!ASAP... #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> #include <dos.h>
0
8425
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8326
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8522
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8622
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2745
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.