Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in RPA by (5.3k points)

i  have this VB Code used in an Invoke Code Activity in UiPath. Can anyone suggest a function which changes the values of variable btnClicked in True when the button is pressed?

Dim lblButton As New System.Windows.Forms.Button() lblButton.AutoSize = True btnClicked=False lblButton.ForeColor = System.Drawing.Color.Black 'lblButton.Location = New System.Drawing.Point(5, 10) lblButton.Left=250 lblButton.Name = "lblButton" lblButton.Size = New System.Drawing.Size(50, 50) lblButton.TabIndex = 4 lblButton.Text = "End data acq" lblbutton.Visible=btnVisible btnClicked=True

1 Answer

0 votes
by (9.5k points)

 I think all you need is to add a handler to the OnClick event. In Windows.Forms.Buttons this fires when the user clicks each time. 

Private Sub My_Clicked_Event(sender As Object, e As EventArgs) Dim lb As System.Windows.Forms.Button = DirectCast(sender, System.Windows.Forms.Button) lb.Text = "I have been clicked" lb.Forecolor = Color.Black MsgBox("Clicked") End Sub

then add the handler in your code

AddHandler lblbutton.Click, AddressOf My_Clicked_Event

Changing variables could simply be done using the casted lb…

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jul 10, 2019 in RPA by noah kapoor (5.3k points)
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...