Results 1 to 16 of 16

Thread: Events

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    19

    Events

    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.

    Any help would be much appreciated.

  2. #2
    Frenzied Member
    Join Date
    Mar 2004
    Location
    Orlando, FL
    Posts
    1,618
    Sure the keypress event exists....

    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.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    19
    i looked.. its not there....

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    19
    events that exist under txtAdjust1B:

    DataBinding
    Disposed
    Init
    Load
    PreRender
    TextChanged
    Unload

    same thing goes for any other textbox.

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Since the name is: txtAdjust1B , we've made the assumption that txtAdjust1B is a text box.... is this the case? Or, if not, then what is txtAdjust1B ?

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    19
    txtAdjust1B is a Textbox

  7. #7
    Frenzied Member
    Join Date
    Mar 2004
    Location
    Orlando, FL
    Posts
    1,618
    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.

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    19
    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.

    System.Object
    System.EventArgs
    System.Windows.Forms.KeyPressEventArgs

    [Visual Basic]
    <ComVisible(True)>
    Public Class KeyPressEventArgs
    Inherits EventArgs



    Just because its in the help files doesnt mean ****.

  9. #9
    PowerPoster SuperSparks's Avatar
    Join Date
    May 2003
    Location
    London, England
    Posts
    265
    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:
    1. Private Sub txtAdjust1B_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtAdjust1B.KeyPress
    2.  
    3.     End Sub
    Nick.

  10. #10

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    19
    QUOTE:

    events that exist under txtAdjust1B:

    DataBinding
    Disposed
    Init
    Load
    PreRender
    TextChanged
    Unload


    if you can find keypress in that list, ill suck ur dick.

  11. #11
    Frenzied Member <ABX's Avatar
    Join Date
    Jul 2002
    Location
    Canada eh...
    Posts
    1,622
    I dont know what your looking at but...



    Start Sucking
    Tips:
    • Google is your friend! Search before posting!
    • Name your thread appropriately... "I Need Help" doesn't cut it!
    • Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
    • Allways Include the Name and Line of the Exception (if one is occuring!)
    • If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)


    If you think I was helpful, rate my post
    IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous

  12. #12

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    19
    No.. YOU start sucking

  13. #13

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    19
    sadf
    Attached Images Attached Images  

  14. #14
    Hyperactive Member CyberHawke's Avatar
    Join Date
    May 2004
    Location
    Washington DC
    Posts
    477
    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.

  15. #15
    Frenzied Member <ABX's Avatar
    Join Date
    Jul 2002
    Location
    Canada eh...
    Posts
    1,622
    hey... i didnt offer

    Please upload the entire form file...

    maybe you accidently edited the Forms Designer Code....
    Tips:
    • Google is your friend! Search before posting!
    • Name your thread appropriately... "I Need Help" doesn't cut it!
    • Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
    • Allways Include the Name and Line of the Exception (if one is occuring!)
    • If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)


    If you think I was helpful, rate my post
    IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous

  16. #16
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width