以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]显示问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=52249)

--  作者:becklxq
--  发布时间:2014/6/12 9:03:00
--  [求助]显示问题
做完软件,窗口最小化时,后面显示登录框,这是什么原因?
--  作者:狐狸爸爸
--  发布时间:2014/6/12 9:04:00
--  

说明你的登录窗口没有关闭,检查登录窗口确定按钮的Click事件代码,是否有关闭此窗口的代码


--  作者:becklxq
--  发布时间:2014/6/12 9:38:00
--  
图片点击可在新窗口打开查看有关闭窗口的代码,
--  作者:becklxq
--  发布时间:2014/6/12 9:40:00
--  


图片点击可在新窗口打开查看此主题相关图片如下:qq图片20140612093905.jpg
图片点击可在新窗口打开查看

 


--  作者:狐狸爸爸
--  发布时间:2014/6/12 9:49:00
--  

有代码,但是没有关闭,说明这个代码没有执行。

你用下面的方法分析一下:

http://www.foxtable.com/help/topics/1485.htm

 

搞不定,就将文件发上来,我们帮你看看


--  作者:becklxq
--  发布时间:2014/6/12 9:51:00
--  

Dim UserName As String = e.Form.Controls("UserName").Value
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
cmd.C
If UserName = ""  Then
    Messagebox.show("请选择用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
End If
cmd.CommandText = "Select * From {Users} Where [Name] = \'" & UserName & "\'"
dt = cmd.ExecuteReader

\'---------------------------------------------------
If dt.DataRows.Count = 0 Then
    Messagebox.show("此用户不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
Else
    dr = dt.DataRows(0)
    If e.Form.Controls("PassWord").Value = dr("Password") Then
        _UserName = UserName
        _UserGroup = dr("Group")
        e.Form.Close
        Forms("主窗口").open()
    Else
        Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    End If
End If


--  作者:狐狸爸爸
--  发布时间:2014/6/12 9:56:00
--  

你的主窗口是个模式窗口吧? 如果是的,这个修改一下:

 

Dim UserName As String = e.Form.Controls("UserName").Value
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
cmd.C
If UserName = ""  Then
    Messagebox.show("请选择用户!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
End If
cmd.CommandText = "Select * From {Users} Where [Name] = \'" & UserName & "\'"
dt = cmd.ExecuteReader

\'---------------------------------------------------
If dt.DataRows.Count = 0 Then
    Messagebox.show("此用户不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
Else
    dr = dt.DataRows(0)
    If e.Form.Controls("PassWord").Value = dr("Password") Then
        _UserName = UserName
        _UserGroup = dr("Group")

        e.Form.BaseForm.Hide()
        e.Form.Close
        Forms("主窗口").open()
    Else
        Messagebox.show("密码错误!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    End If
End If

 

 


--  作者:becklxq
--  发布时间:2014/6/12 10:03:00
--  
谢谢狐狸爸爸,是模式窗口,现在可以了。