Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need a way to code around an event such as a user entered something in a text and when they press enter or click an event should happened that will validate the user input and save it to the spreadsheet
Posted

Drop a button on, double click the button and VS will add the Click handler for you and take you to the code
You can then validate and save according to your validation rules, whatever they happen to be.
 
Share this answer
 
Comments
Rendani.Nk 11-May-11 10:39am    
ok,cool but is the way to code this event without having to click on a button, but the textbox maybe and just process everthing?
Google[^] is your friend. Here's[^] the first result and here's[^] the second. Both appear, at a glance, to be helpful.
 
Share this answer
 
You haven't noticed the Validating event[^] of the TextBox, have you?
 
Share this answer
 
it may help you to create events....
VB
Public Class Form1
    Private WithEvents ED, ed2 As New EventDemo

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ED.sampleOparation("1st object event")
        AddHandler ed2.sampleevent, AddressOf ED_sampleevent
        ed2.sampleOparation("2nd object event")
    End Sub

    Private Sub ED_sampleevent(ByVal sender As Object, ByVal e As EventDemo.EventArg) Handles ED.sampleevent
        MsgBox(e.myval)
             '''Apply your validation rule here
    End Sub
End Class



Public Class EventDemo
    Public Event sampleevent(ByVal sender As Object, ByVal e As EventArg)
    Public Sub sampleOparation(ByVal sometext As String)
        Dim e As New EventArg
        e.myval = sometext
        RaiseEvent sampleevent(Me, e)
    End Sub
    Public Class EventArg
        Inherits EventArgs
        Public myval As String

    End Class
End Class
 
Share this answer
 
Comments
Rendani.Nk 11-May-11 10:28am    
will try this tx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900