Dim ftp1 As New FtpClient
ftp1.Host=Tables("FTPIP").Current("FTPhost")
ftp1.Account = Tables("FTPIP").Current("FTPAccount")
ftp1.Password = Tables("FTPIP").Current("FTPpassword")
Dim img As String = ProjectPath & "Attachments\上传身份证.jpg"
Dim r As Row = Tables("员工工资系统_员工信息").Current
Dim sfz As String = r("证件图1")
Dim pbxz As WinForm.PictureBox = e.Form.Controls("证件图片1")
Dim pbx As WinForm.Label = e.Form.Controls("L证件图片1")
If r.IsNull("证件图1") = False AndAlso ftp1.FileExists(sfz) Then
pbxz.FtpClient = ftp1
pbxz.ImageFile = sfz
pbxz.Visible = True
pbx.Visible = True
Else
pbxz.Image = getImage(img)
pbxz.Visible = True
pbx.Visible = True
End If
现在这个问题解决了,但是还有一个问题
在打开窗口是第一次点击图片时,先显示的是第一行的图片,后面再点击是没问题的,请问怎么解决
不如说 我在表格点击第二行,他会先显示第一行的图片然后更新,如果第二行没有图片则直接显示第一行的图片指导你点击其他行再点回来就恢复正常了,请问有什么办法解决
下面是
PositionChanged的全部代码
e.Form.Controls("序号").text = Tables("员工工资系统_员工信息").Position +1
e.Form.Controls("员工姓名").Visible = True
e.Form.Controls("员工编号").Visible = True
e.Form.Controls("证件号码").Visible = True
e.Form.Controls("性别").Visible = True
e.Form.Controls("所在部门").Visible = True
e.Form.Controls("职务").Visible = True
e.Form.Controls("工资类别").Visible = True
e.Form.Controls("工资数据").Visible = True
e.Form.Controls("结算方式").Visible = True
e.Form.Controls("账号").Visible = True
e.Form.Controls("选中行").Visible = True
Dim n As Integer = Tables("员工工资系统_员工信息").Rows.Count
Dim lbl As WinForm.Label
lbl = e.Form.Controls("总行数")
lbl.Text = "目前共有 " & n & " 条员工数据!"
Dim lbl2 As WinForm.Label
lbl2 = e.Form.Controls("选中行")
lbl2.Text = " 现在编辑的是员工信息第" & (Tables("员工工资系统_员工信息").Position + 1) & "行,姓名为: " & (Tables("员工工资系统_员工信息").Current("员工姓名")) & " 的员工"
Dim ftp1 As New FtpClient
ftp1.Host=Tables("FTPIP").Current("FTPhost")
ftp1.Account = Tables("FTPIP").Current("FTPAccount")
ftp1.Password = Tables("FTPIP").Current("FTPpassword")
Dim img As String = ProjectPath & "Attachments\上传身份证.jpg"
Dim r As Row = Tables("员工工资系统_员工信息").Current
Dim sfz As String = r("证件图1")
Dim pbxz As WinForm.PictureBox = e.Form.Controls("证件图片1")
Dim pbx As WinForm.Label = e.Form.Controls("L证件图片1")
Dim ygxm As WinForm.Label = e.Form.Controls("员工姓名")
If r.IsNull("证件图1") = False AndAlso ftp1.FileExists(sfz) Then
pbxz.FtpClient = ftp1
pbxz.ImageFile = sfz
pbxz.Visible = True
pbx.Visible = True
Else
pbxz.Image = getImage(img)
pbxz.Visible = True
pbx.Visible = True
End If