Click here to Skip to main content
16,007,277 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How to update a datagrid from a Command builder Pin
Dave Kreskowiak9-Jan-08 4:14
mveDave Kreskowiak9-Jan-08 4:14 
GeneralRe: How to update a datagrid from a Command builder Pin
Vimalsoft(Pty) Ltd9-Jan-08 4:21
professionalVimalsoft(Pty) Ltd9-Jan-08 4:21 
GeneralRe: How to update a datagrid from a Command builder Pin
Dave Kreskowiak9-Jan-08 5:02
mveDave Kreskowiak9-Jan-08 5:02 
Questionmp3 steganography Pin
thanmas9-Jan-08 0:38
thanmas9-Jan-08 0:38 
GeneralRe: mp3 steganography Pin
Dave Kreskowiak9-Jan-08 4:10
mveDave Kreskowiak9-Jan-08 4:10 
Generalsyntax highlighting in richtextbox Pin
balakpn9-Jan-08 0:32
balakpn9-Jan-08 0:32 
GeneralRe: syntax highlighting in richtextbox Pin
Dave Kreskowiak9-Jan-08 4:09
mveDave Kreskowiak9-Jan-08 4:09 
QuestionNeed Help on Delegates Pin
Senthil S8-Jan-08 23:05
Senthil S8-Jan-08 23:05 
Hi all,

I working in a project where i want use keypress event in mouse event. So i decided to call Delegates.. But i am getting error...

The Error is in convertion of object to textbox... I give full coding below this.....



Dim myHandler As Windows.Forms.KeyPressEventHandler<br />
<br />
    Custom Event myEvent As Windows.Forms.KeyPressEventHandler<br />
        AddHandler(ByVal value As Windows.Forms.KeyPressEventHandler)<br />
            myHandler = value<br />
        End AddHandler<br />
<br />
        RemoveHandler(ByVal value As Windows.Forms.KeyPressEventHandler)<br />
            myHandler = Nothing<br />
        End RemoveHandler<br />
<br />
        RaiseEvent(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)<br />
            If Not myHandler Is Nothing Then<br />
              Me.TextBox1.Invoke(sender, e)            Else<br />
            End If<br />
        End RaiseEvent<br />
    End Event<br />
<br />
    Sub raise_event()<br />
        Dim sender As New Object<br />
        Dim e As System.Windows.Forms.KeyPressEventArgs<br />
        RaiseEvent myEvent(sender, e)<br />
    End Sub<br />
<br />
<br />
    Dim d1 As Windows.Forms.KeyPressEventHandler<br />
<br />
<br />
    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
        d1 = New Windows.Forms.KeyPressEventHandler(AddressOf MyDelegate)<br />
    End Sub<br />
<br />
    Sub MyDelegate(ByVal sender As Object, ByVal e As Windows.Forms.KeyPressEventArgs)<br />
        If Asc(e.KeyChar) = 65 Then<br />
            MsgBox("65")<br />
        ElseIf Char.IsLetterOrDigit(e.KeyChar) <> True Then<br />
            MsgBox(Asc(e.KeyChar))<br />
        End If<br />
    End Sub<br />
<br />
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
        AddHandler Me.myEvent, d1<br />
        raise_event()<br />
    End Sub




Can any one tell where should i change.

Note.
I am using Keypress for Textbox. When i click by mouse the keypress event of the textbox should enable and do the required work

Can any one help me to solve this problem.............

Thank you in Advance

Senthil.S

Senthil S
Software Engineer

GeneralRe: Need Help on Delegates Pin
Dave Kreskowiak9-Jan-08 4:05
mveDave Kreskowiak9-Jan-08 4:05 
GeneralMonth&Year Pin
Priya S8-Jan-08 20:23
Priya S8-Jan-08 20:23 
GeneralRe: Month&Year Pin
Christian Graus8-Jan-08 20:43
protectorChristian Graus8-Jan-08 20:43 
GeneralRe: Month&Year Pin
Priya S8-Jan-08 20:56
Priya S8-Jan-08 20:56 
GeneralHelp to add CheckBox control to the flexgrid Pin
aaraaayen8-Jan-08 19:50
aaraaayen8-Jan-08 19:50 
GeneralRe: Help to add CheckBox control to the flexgrid Pin
Dave Kreskowiak9-Jan-08 3:58
mveDave Kreskowiak9-Jan-08 3:58 
GeneralDataTable and Labels... Pin
Illegal Operation8-Jan-08 19:11
Illegal Operation8-Jan-08 19:11 
GeneralRe: DataTable and Labels... Pin
Christian Graus8-Jan-08 19:21
protectorChristian Graus8-Jan-08 19:21 
GeneralRe: DataTable and Labels... Pin
Illegal Operation8-Jan-08 20:00
Illegal Operation8-Jan-08 20:00 
Questionhow to zip/Unzip Files Pin
irfanahsan8-Jan-08 18:53
irfanahsan8-Jan-08 18:53 
AnswerRe: how to zip/Unzip Files Pin
Reza Raad8-Jan-08 19:56
Reza Raad8-Jan-08 19:56 
GeneralRe: how to zip/Unzip Files Pin
Nilesh Hapse8-Jan-08 20:20
Nilesh Hapse8-Jan-08 20:20 
Generalbacked-up file destination Pin
Tony Rose Victorino8-Jan-08 18:42
Tony Rose Victorino8-Jan-08 18:42 
QuestionRe: backed-up file destination Pin
Reza Raad8-Jan-08 20:02
Reza Raad8-Jan-08 20:02 
GeneralRe: backed-up file destination Pin
Dave Kreskowiak9-Jan-08 3:54
mveDave Kreskowiak9-Jan-08 3:54 
GeneralRe: backed-up file destination Pin
Johan Hakkesteegt10-Jan-08 5:29
Johan Hakkesteegt10-Jan-08 5:29 
Questionwhen creating a schedule task what are the things that you need to consider? Pin
Tony Rose Victorino8-Jan-08 18:36
Tony Rose Victorino8-Jan-08 18:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.