Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

When I try to add the following line, I get an error saying Ctrls_TextChanged is undefined. Any ideas?

 

AddHandler MyCombo.TextChanged, AddressOf Ctrls_TextChanged

 

What is the exact address of this procedure/constant? Like system.windows.forms.datagrid.ctrls_textchanged or is there one? My VB likes to be specific :-/

Posted

Enigma151,

 

If you right click in the middle of "Ctrls_TextChanged" text in your piece of code that says:

 

AddHandler MyCombo.TextChanged, AddressOf Ctrls_TextChanged

 

Then you should get a context menu.

On that context menu select "Go To Definition" (should be the 3rd one up from the bottom of the menu).

 

You will then be taken to the location of the Event Handler (if it exists at all).

 

georg

  • *Experts*
Posted
Erm... there is no "Procedure Constant" -- you need to create it yourself. Somewhere in the form, create this procedure:
Private Sub ComboTextChanged(ByVal sender As Object, ByVal e As EventArgs)
 'this code will fire whenever the text of the combo changes
End Sub

Posted

If you click in the function/sub so the cursor is in the text, you can press [sHIFT]+[F2]. Either the Goto Definition or Shift/F2 will take you to the sub/function.

 

The Sub Ctrls_TextChanged needs to be created by you. The TextChanged event takes the parameters (ByVal sender As Object, ByVal e As System.EventArgs). So, create your sub as follows:

 

 

Private Sub Ctrls_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs)

' Your code here

End Sub

rustyd
Posted

Enigma151,

 

As VolteFace indicated, I got it (cough) wrong when I told you to use "Go To Definition" to find the Procedure.

 

You won't be able to "go to the definition" and find the Procedure, because, as your error message and VolteFace so succinctly explained, it does not exist and you need to create it.

 

georg

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...