Jump to content

Visual Basic Express 2005


lewmur

Recommended Posts

I'm trying to convert a VB6 project to 2005 Express and have a problem with the code to execute the code in a command button. In VB6 the code was:Command1.Value = True2005 conversion wizard converted this toCommand1.PerformClick()Sound reasonable but it doesn't work. I put in a "break" to step through the code and when it hits this line it just step through without executing the code in the command button.

Link to comment
Share on other sites

Me.Command1.PerformClick()
No. Turns out the command won't exectute unless visable is set to true, even though it is enalbled. Worked fine in VB6. I guess I can move the buttons "off screen" or make them so small they aren't noticeable. Edited by lewmur
Link to comment
Share on other sites

For the 'Click' event, the 'e' parameter contains a reference to 'EventArgs.Empty' by default. Command1_click(nothing,nothing) 'We are passing nothing becasue we dont wantnothing to be passed.If you want to pass some parameters you may do it here.;;;If Not Sender is Nothing then 'do every special thing that is not general for a raiser of this routine.End if;;;

Link to comment
Share on other sites

For the 'Click' event, the 'e' parameter contains a reference to 'EventArgs.Empty' by default. Command1_click(nothing,nothing) 'We are passing nothing becasue we dont wantnothing to be passed.If you want to pass some parameters you may do it here.;;;If Not Sender is Nothing then 'do every special thing that is not general for a raiser of this routine.End if;;;
	' If myVar is an even number, click Button2.	If myVar Mod 2 = 0 Then		button2.PerformClick()		' Display the status of Button2's Click event.		MessageBox.Show("button2 was clicked ")	Else		' Display the status of Button2's Click event.		MessageBox.Show("button2 was NOT clicked")	End If	' Increment myVar.   	myVar = myVar + 1

This is the example given by "Help" for the "PerformClick method." Says nothing about any "e" parameter. And as soon as I made the buttons visable, the code executed. However, the button click does already had the "e" and it still didn't work with visible set to false.

 Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Edited by lewmur
Link to comment
Share on other sites

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...