Hello all,
I use the SetFocus command in certain instances. However, after that is done, I want to remove that set focus. How is that done?
Here’s my code. As you can see, at the end of the event I call SetFocus on the Container itself. But, in practice the field that had the set focus command still retains it.
Any ideas would be appreciated!
Thanks,
Tim
Sub Pressed(row As Integer, column As Integer) Handles Pressed
Select Case Activecnt
Case "cntCreateUnit"
Dim UID As String = Me.CellTextAt(row, 0)
Session.ACP_Units.ChangeSID(SID.ToString)
Dim Result As Integer = Session.ACP_Units.getUnitID(UID, True)
Call cntCreateUnit.Clear
cntCreateUnit.fldBldgNo.Text = Session.ACP_Units.BldgNo
cntCreateUnit.fldDoorNo.Text = Session.ACP_Units.DoorNo
cntCreateUnit.fldUnitID.Text = Session.ACP_Units.UnitID
cntCreateUnit.fldUnitID.SetFocus
cntCreateUnit.fldUnitName.Text = ""
cntCreateUnit.chkLockedOut.Value = False
If Session.ACP_Units.LockedOut = "Y" Then cntCreateUnit.chkLockedOut.Value = True
cntCreateUnit.chkNRCUnit.Value = False
If Session.ACP_Units.NRC = "Y" Then cntCreateUnit.chkNRCUnit.Value = True
cntCreateUnit.chkOutOfService.Value = False
If Session.ACP_Units.OutOfService = "Y" Then cntCreateUnit.chkOutOfService.Value = True
cntCreateUnit.chkSAPUnit.Value = False
If Session.ACP_Units.SAP = "Y" Then cntCreateUnit.chkSAPUnit.Value = True
cntCreateUnit.chkWireless.Value = False
cntCreateUnit.cmbAlarmZone.SelectRowWithText(Session.ACP_Units.AlarmZone.ToString )
cntCreateUnit.cmbFloor.SelectRowWithText(Session.ACP_Units.Floor.ToString)
cntCreateUnit.cmbKPZone.SelectRowWithText(Session.ACP_Units.KeypadZone.ToString)
//cntCreateUnit.cmbUnitID_Len.SelectRowWithText(Session.ACP_Units.
//cntCreateUnit.cmbWirelessZone.SelectRowWithText(Session.ACP_Units.
//cntCreateUnit.fldBldgNo.Text = Session.ACP_Units.BldgNo
//cntCreateUnit.fldDoorNo.Text = Session.ACP_Units.DoorNo
//cntCreateUnit.fldUnitID.Text = Session.ACP_Units.UnitID
//cntCreateUnit.fldUnitName.Text = ""
cntCreateUnit.SetFocus
Return
Case "Assign Messages"
End Select
Return
Exception e As RuntimeException
Dim Logs As New clsLogging
Dim Flds() As String = Array("EXCEPTION", CurrentMethodName, CStr( e.Type) )
Logs.AddFields Flds
Logs.LogFileAppend( Logs.K_Except_App_Err)
End Sub
4 posts - 4 participants