I want to know how to add an event. If any of you have added an event before, please look into your code again and paste everything you did to add that event.
Since I am a newbie at this, I will make sure im making sense. so im going to clarify more.
Private Sub cmdAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAdd.Click
end sub
now.. the event '_click' or 'click' was obviously already added in the program.
I want to beable to add my own event.
Private Sub txtAdjust1B_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtAdjust1B.KeyPress
If KeyAscii = 9 Then
cmdAccept.Enabled = True
End If
End Sub
In vb.NET the 'KeyPress' event does not exist. I want to add this.
In those top two combo boxes above your code, select txtAdjust1B on the left and then Keypress on the right
Sean
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
What version of VB.NET are you using, some student version?
Here is right out of the help files:
AcceptsTabChanged (inherited from TextBoxBase) Occurs when the value of the AcceptsTab property has changed.
AutoSizeChanged (inherited from TextBoxBase) Occurs when the value of the AutoSize property has changed.
BackColorChanged (inherited from Control) Occurs when the value of the BackColor property changes.
BackgroundImageChanged (inherited from Control) Occurs when the value of the BackgroundImage property changes.
BindingContextChanged (inherited from Control) Occurs when the value of the BindingContext property changes.
BorderStyleChanged (inherited from TextBoxBase) Occurs when the value of the BorderStyle property has changed.
CausesValidationChanged (inherited from Control) Occurs when the value of the CausesValidation property changes.
ChangeUICues (inherited from Control) Occurs when the focus or keyboard user interface (UI) cues change.
Click (inherited from TextBoxBase) Occurs when the text box is clicked.
ContextMenuChanged (inherited from Control) Occurs when the value of the ContextMenu property changes.
ControlAdded (inherited from Control) Occurs when a new control is added to the Control.ControlCollection.
ControlRemoved (inherited from Control) Occurs when a control is removed from the Control.ControlCollection.
CursorChanged (inherited from Control) Occurs when the value of the Cursor property changes.
Disposed (inherited from Component) Adds an event handler to listen to the Disposed event on the component.
DockChanged (inherited from Control) Occurs when the value of the Dock property changes.
DoubleClick (inherited from Control) Occurs when the control is double-clicked.
DragDrop (inherited from Control) Occurs when a drag-and-drop operation is completed.
DragEnter (inherited from Control) Occurs when an object is dragged into the control's bounds.
DragLeave (inherited from Control) Occurs when an object is dragged out of the control's bounds.
DragOver (inherited from Control) Occurs when an object is dragged over the control's bounds.
EnabledChanged (inherited from Control) Occurs when the Enabled property value has changed.
Enter (inherited from Control) Occurs when the control is entered.
FontChanged (inherited from Control) Occurs when the Font property value changes.
ForeColorChanged (inherited from Control) Occurs when the ForeColor property value changes.
GiveFeedback (inherited from Control) Occurs during a drag operation.
GotFocus (inherited from Control) Occurs when the control receives focus.
HandleCreated (inherited from Control) Occurs when a handle is created for the control.
HandleDestroyed (inherited from Control) Occurs when the control's handle is in the process of being destroyed.
HelpRequested (inherited from Control) Occurs when the user requests help for a control.
HideSelectionChanged (inherited from TextBoxBase) Occurs when the value of the HideSelection property has changed.
ImeModeChanged (inherited from Control) Occurs when the ImeMode property has changed.
Invalidated (inherited from Control) Occurs when a control's display requires redrawing.
KeyDown (inherited from Control) Occurs when a key is pressed while the control has focus.
KeyPress (inherited from Control) Occurs when a key is pressed while the control has focus.
KeyUp (inherited from Control) Occurs when a key is released while the control has focus.
Layout (inherited from Control) Occurs when a control should reposition its child controls.
Leave (inherited from Control) Occurs when the input focus leaves the control.
LocationChanged (inherited from Control) Occurs when the Location property value has changed.
LostFocus (inherited from Control) Occurs when the control loses focus.
ModifiedChanged (inherited from TextBoxBase) Occurs when the value of the Modified property has changed.
MouseDown (inherited from Control) Occurs when the mouse pointer is over the control and a mouse button is pressed.
MouseEnter (inherited from Control) Occurs when the mouse pointer enters the control.
MouseHover (inherited from Control) Occurs when the mouse pointer hovers over the control.
MouseLeave (inherited from Control) Occurs when the mouse pointer leaves the control.
MouseMove (inherited from Control) Occurs when the mouse pointer is moved over the control.
MouseUp (inherited from Control) Occurs when the mouse pointer is over the control and a mouse button is released.
MouseWheel (inherited from Control) Occurs when the mouse wheel moves while the control has focus.
Move (inherited from Control) Occurs when the control is moved.
MultilineChanged (inherited from TextBoxBase) Occurs when the value of the Multiline property has changed.
Paint (inherited from Control) Occurs when the control is redrawn.
ParentChanged (inherited from Control) Occurs when the Parent property value changes.
QueryAccessibilityHelp (inherited from Control) Occurs when AccessibleObject is providing help to accessibility applications.
QueryContinueDrag (inherited from Control) Occurs during a drag-and-drop operation and allows the drag source to determine whether the drag-and-drop operation should be canceled.
ReadOnlyChanged (inherited from TextBoxBase) Occurs when the value of the ReadOnly property has changed.
Resize (inherited from Control) Occurs when the control is resized.
RightToLeftChanged (inherited from Control) Occurs when the RightToLeft property value changes.
SizeChanged (inherited from Control) Occurs when the Size property value changes.
StyleChanged (inherited from Control) Occurs when the control style changes.
SystemColorsChanged (inherited from Control) Occurs when the system colors change.
TabIndexChanged (inherited from Control) Occurs when the TabIndex property value changes.
TabStopChanged (inherited from Control) Occurs when the TabStop property value changes.
TextAlignChanged Occurs when the value of the TextAlign property has changed.
TextChanged (inherited from Control) Occurs when the Text property value changes.
Validated (inherited from Control) Occurs when the control is finished validating.
Validating (inherited from Control) Occurs when the control is validating.
VisibleChanged (inherited from Control) Occurs when the Visible property value changes.
Sean
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
when i click on 'help' then 'About Microsoft Visual Basic .NET' then it says 'Microsoft .NET Framework 1.1' 'Version 1.1'
so ill assume its that version.
also, about the help files.. ya.. my crap says stuff in the help files about KeyPress
KeyPressEventArgs ClassSee Also
KeyPressEventArgs Members | System.Windows.Forms Namespace | OnKeyPress | KeyPress | KeyEventArgs | OnKeyDown | KeyDown | OnKeyUp | KeyUp | KeyPressEventArgs Members (Visual J# Syntax) | Managed Extensions for C++ Programming
Requirements
Namespace: System.Windows.Forms
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework - Windows CE .NET
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Language
C#
C++
JScript
Visual Basic
Show All
Provides data for the KeyPress event.
For a list of all members of this type, see KeyPressEventArgs Members.
In the code editor, find the txtAdjust1B entry in the left-hand drop down list at the top, then find KeyPress in the right-hand box. This is what you should get:
VB Code:
Private Sub txtAdjust1B_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtAdjust1B.KeyPress
Looks like you are using a non-standard .NET textbox there. The list doesn't contain even a fourth of the available events associated with the normal textbox control that ships with .NET.
Originally posted by <ABX
maybe you accidently edited the Forms Designer Code....
Can't see how that would affect the intellisense list of available events.
Anyway, he is showing some events which DONT exist in the declarations for VB.NET textboxes. Anyone know a control which has as DataBinding Event? (Not property)
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.