×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Calling one event procedure from another - HOW-TO?

Calling one event procedure from another - HOW-TO?

Calling one event procedure from another - HOW-TO?

(OP)
Colleagues,
In other IV-level languages (at least B4 .NET), I could do something like this (quasi-code, of course)

CODE

PROC cboNumOfItems.SelectedIndexChanged()
IF cboNumOfItems.Selected Index > 0
   chkAllInOne.Enabled = True
ELSE
   chkAllInOne.Enabled = False
ENDIF
ENDPROC

PROC cboNumOfItems.KeyPress(KeyCode)
IF KeyCode = 13
   cboNumOfItems.SelectedIndexChanged() ' Calling another event procedure
ENDIF
ENDPROC 

As it happens, such a need arose in my project (VS 2019, VB .NET). I tried to figure out how to do this call - and failed.
And this article in Help, https://learn.microsoft.com/en-us/dotnet/visual-ba..., doesn't help me.

Could anyone here "translate" this above code into this modern VB .NET, please?
TIA!

Regards,

Ilya

RE: Calling one event procedure from another - HOW-TO?

Would this help you ponder - Click a button programmatically
May get you on the right path...

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: Calling one event procedure from another - HOW-TO?

(OP)
Thank you, Andy, but unfortunately ComboBox has no PerformElectedInedxChanged() method, only the one on the screenshot, PerformLayout.



And even that latter can't be found in the MS documentation: https://learn.microsoft.com/en-us/dotnet/api/syste...:



Any other suggestions, colleagues, would be greatly appreciated!

Regards,

Ilya

RE: Calling one event procedure from another - HOW-TO?

Another way would be:

CODE

PROC cboNumOfItems.SelectedIndexChanged()
    Call JustDoIt()
ENDPROC

PROC cboNumOfItems.KeyPress(KeyCode)
IF KeyCode = 13
   Call JustDoIt() ' Calling another event procedure
ENDIF
ENDPROC 

PROC JustDoIt()
IF cboNumOfItems.Selected Index > 0
   chkAllInOne.Enabled = True
ELSE
   chkAllInOne.Enabled = False
ENDIF
END PROC 

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: Calling one event procedure from another - HOW-TO?

(OP)
Got it!
Thank you!

(I wonder why I didn't think it up myself... gettin' older, I guess! sad )

Regards,

Ilya

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close