Enigma151 Posted July 9, 2003 Posted July 9, 2003 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 :-/ Quote
georg Posted July 9, 2003 Posted July 9, 2003 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 Quote
*Experts* Volte Posted July 9, 2003 *Experts* Posted July 9, 2003 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 Quote
Enigma151 Posted July 9, 2003 Author Posted July 9, 2003 I am trying to set up comboboxes in a datagrid: http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q323167 I tried the "Goto Definition" but nothing happened... Quote
rustyd Posted July 9, 2003 Posted July 9, 2003 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 Quote rustyd
georg Posted July 10, 2003 Posted July 10, 2003 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.