tags:

views:

76

answers:

2

Hi

When pressed Once,i want to make the Grid view Button(Time In) invisible until the User press Time Out Button. Once the user press the Time Out Button,Time in Button must be shown

A: 

Have you looked at NServiceBus? Here's an introduction to it. http://www.udidahan.com/2009/02/07/nservicebus-19/

Jonathan Parker
A: 

Hi KSCD,

Just use the .Visible property on the buttons. For example:

btnTimeOut.Visible = False 'This will hide it
btnTimeOut.Visible = True  ' ... and this will show it

To implement your solution, I'm assuming you've got two separate event handlers for each of your buttons. What you'd want to do is something like this:

Sub btnTimeIn_Click(o as Object, e as EventArgs) 
  'Hide the button now it has been clicked
  Me.btnTimeIn.Visible = False

  'Do some other stuff, such as record the Time In here...
End Sub

And then:

Sub btnTimeOut_Click(o as Object, e as EventArgs) 
 'Show the TimeIn button again
 Me.btnTimeIn.Visible = True

 'Record the time out etc...
End Sub

You can use the Load or Init events of the form to initialise the state of the buttons, i.e:

If Not Page.IsPostBack
 InitialiseButtons()
End If

Private Sub InitialiseButtons()
 Me.btnTimeIn.Visible = True
 Me.btnTimeOut.Visible = False
End Sub

The "If Not Page.IsPostBack" property will stop your form being accidentally reset when the user clicks on one of your buttons after the initial load.

Hope this helps, feel free to pop any questions back up here.

Cheers,

/Richard.

Richard