HELP!

  • Thread starter Thread starter dzemo
  • Start date Start date
D

dzemo

Hi I created windows user contorl and added reference to other project.
Control contains TextBox and PictureBox. How to handle some event of textbox
(validating for example) of user control in form?
Thank's
 
Hi,

Add the event to the control. Raise the controls event in the
textbox event.

Public Shadows Event Validating(ByVal sender As Object, ByRef e As
System.ComponentModel.CancelEventArgs)



Private Sub TextBox1_Validating(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating

RaiseEvent Validating(Me, e)

End Sub



Ken

--------------------------------

Hi I created windows user contorl and added reference to other project.
Control contains TextBox and PictureBox. How to handle some event of textbox
(validating for example) of user control in form?
Thank's
 
The whole idea of a User COntrol is to do things like that in the control
itself, not in the form.

But if you really want to do this you will have to declare the textbox as
public in your control, instead of private (default).

Telmo Sampaio
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top