D
Dan Shepherd
Is there a way to disable a number of fields (50+) using Visual Basic 2005?
I have a window that used an imported control in vb 6 but now relies on .Net
control.. The old logic was:
Dim mycontrol As SWIMAPI.SIVControl
If RTrim(bXUNAPPRPROF.uprofileid) <> "" Then
For Each mycontrol In SWIMAPIVbaObjectModel_definst.sivMyApp.Controls
If mycontrol.Properties("controltype").value = "SAFMaskedText" Or
mycontrol.Properties("controltype").value = "SAFCombo" Or
mycontrol.Properties("controltype").value = "SAFDate" Or
mycontrol.Properties("controltype").value = "SAFMaskedFloat" Then
If mycontrol.Properties("name").value <> "cprofilereference" Then
mycontrol.Properties("enabled").value = False
End If
End If
Next mycontrol
Else
For Each mycontrol In SWIMAPIVbaObjectModel_definst.sivMyApp.Controls
If mycontrol.Properties("controltype").value = "SAFMaskedText" Or
mycontrol.Properties("controltype").value = "SAFCombo" Or
mycontrol.Properties("controltype").value = "SAFDate" Or
mycontrol.Properties("controltype").value = "SAFMaskedFloat" Then
If mycontrol.Properties("name").value <> "cuprofileid" And
VB.Right(RTrim(mycontrol.Properties("name").value), 3) <> "qty" And
mycontrol.Properties("name").value <> "cuapprovstatus" And
mycontrol.Properties("name").value <> "cuapprovalnumber" And
mycontrol.Properties("name").value <> "cuapprovaldate" And
mycontrol.Properties("name").value <> "cuapproveexpiry" Then
mycontrol.Properties("enabled").value = True
End If
End If
Next mycontrol
End If
How would I rewrite this in VB 2005?
I have a window that used an imported control in vb 6 but now relies on .Net
control.. The old logic was:
Dim mycontrol As SWIMAPI.SIVControl
If RTrim(bXUNAPPRPROF.uprofileid) <> "" Then
For Each mycontrol In SWIMAPIVbaObjectModel_definst.sivMyApp.Controls
If mycontrol.Properties("controltype").value = "SAFMaskedText" Or
mycontrol.Properties("controltype").value = "SAFCombo" Or
mycontrol.Properties("controltype").value = "SAFDate" Or
mycontrol.Properties("controltype").value = "SAFMaskedFloat" Then
If mycontrol.Properties("name").value <> "cprofilereference" Then
mycontrol.Properties("enabled").value = False
End If
End If
Next mycontrol
Else
For Each mycontrol In SWIMAPIVbaObjectModel_definst.sivMyApp.Controls
If mycontrol.Properties("controltype").value = "SAFMaskedText" Or
mycontrol.Properties("controltype").value = "SAFCombo" Or
mycontrol.Properties("controltype").value = "SAFDate" Or
mycontrol.Properties("controltype").value = "SAFMaskedFloat" Then
If mycontrol.Properties("name").value <> "cuprofileid" And
VB.Right(RTrim(mycontrol.Properties("name").value), 3) <> "qty" And
mycontrol.Properties("name").value <> "cuapprovstatus" And
mycontrol.Properties("name").value <> "cuapprovalnumber" And
mycontrol.Properties("name").value <> "cuapprovaldate" And
mycontrol.Properties("name").value <> "cuapproveexpiry" Then
mycontrol.Properties("enabled").value = True
End If
End If
Next mycontrol
End If
How would I rewrite this in VB 2005?