VB程序员博客

VB程序开发

Archive for 01月, 2010

我将一些信息写入xml文件,做了个按钮,第一次点击按钮能成功写入xml,第二次点击按钮,程序运行到dataelement.AppendChild(elem)的时候报错:
未处理的“System.ArgumentException”类型的异常出现在 System.Xml.dll 中。

其他信息: 要插入的节点出自不同的文档上下文。
部分代码如下,请高手帮我分析分析! 谢谢!     
For Each it In DataGridView_dataelement.Rows
            elem = FormBrowser.tpldoc.CreateElement("elem")
            If it.Cells(0).Value <> "" And it.Cells(1).Value <> "" And it.Cells(2).Value <> "" Then
                elem.SetAttribute("from", it.Cells(0).Value)
                elem.SetAttribute("to", it.Cells(1).Value)
                elem.SetAttribute("toelementtype", it.Cells(2).Value)
                dataelement.AppendChild(elem)要插入的节点出自不同的文档上下文。
不是已经告诉你了么。要插入的节点出自不同的文档上下文。
不是已经告诉你了么。


也想像别人一样,用VB来调用webservice,有那位大侠有例子给我看看么放到技术区去问吧,水源没意思。
地板到技术区吧

JF不懂哦,搜索了下,肥皂不合适?<
如果是我就改用AutoHotKey软件百度上多啊,自己多动手就行了。

能不用webbrowser就尽量不用,我这样认为。lz是2角了怎么不明白这个道理,移帖到技术区,会有人给答案的接分,没答案!


我写的代码是:           
Set frames = thisdocument.getElementsByTagName("frame")
            For i = 0 To frames.length-1
                If frames(i).name = "frame1" Then
                  vb_thisFrame = frames(i)
                End If
    Next

调试的时候在这里出错If frames(i).name = vb_vb_thisFramename Then,不知道应该怎么弄? 
请高手指点!

thisdocument.  ………

Word 文档?
它好象不支持控件数组吧!


我将一些信息写入xml文件,做了个按钮,第一次点击按钮能成功写入xml,第二次点击按钮,程序运行到dataelement.AppendChild(elem)的时候报错:
未处理的“System.ArgumentException”类型的异常出现在 System.Xml.dll 中。

其他信息: 要插入的节点出自不同的文档上下文。
部分代码如下,请高手帮我分析分析! 谢谢!     
For Each it In DataGridView_dataelement.Rows
            elem = FormBrowser.tpldoc.CreateElement("elem")
            If it.Cells(0).Value <> "" And it.Cells(1).Value <> "" And it.Cells(2).Value <> "" Then
                elem.SetAttribute("from", it.Cells(0).Value)
                elem.SetAttribute("to", it.Cells(1).Value)
                elem.SetAttribute("toelementtype", it.Cells(2).Value)
                dataelement.AppendChild(elem)要插入的节点出自不同的文档上下文。
不是已经告诉你了么。要插入的节点出自不同的文档上下文。
不是已经告诉你了么。


Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        choice()
        If Not IsNumeric(TextBox3.Text) Then
            MsgBox("Please enter a number…")
        ElseIf Val(TextBox3.Text) = Val(TextBox4.Text) Then
            Static a As Integer
            a = a + 1
            Label5.Text = "正确个数:" & a
            Label4.ForeColor = Color.Blue
            Dim i As Integer = CInt(Int((4 * Rnd()) + 1))
            If i = 1 Then
                Label4.Text = "Very good!"
            End If
            If i = 2 Then
                Label4.Text = "Excellent!"
            End If
            If i = 3 Then
                Label4.Text = "Nice Work!"
            End If
            If i = 4 Then
                Label4.Text = "Keep up the good work!"
            End If
        ElseIf Val(TextBox3.Text) <> Val(TextBox4.Text) Then
            Static b As Integer
            b = b + 1
            Label6.Text = "错误个数:" & b
            Label4.ForeColor = Color.Red
            Dim i As Integer = CInt(Int((4 * Rnd()) + 1))
            If i = 1 Then
                Label4.Text = "No.Please try again."
            End If
            If i = 2 Then
                Label4.Text = "Wrong.Try once more."
            End If
            If i = 3 Then
                Label4.Text = "Don't give up!"
            End If
            If i = 4 Then
                Label4.Text = "No.Keep trying."
            End If
        End If

设置一个按钮,点击按钮会弹出msgbox并在其中显示 正确个数占总个数的百分比,也就是像X%,显示完之后正确个数和错误个数全部清零,从新开始。 一定要是在VB2008里运行的~~

谢谢各位了~~~~


RT
可以分類存檔,分類查詢等

老馬,老V 等等達人速速獻身阿
sf友情顶贴…………
扫描仪一般厂家提供接口的~ 要接口現在可以不計接口
只想看看類似的問題的設計方法~~
大大們 再幫幫~~友情帮顶。。。<
扫描仪源码
http://www.pudn.com/downloads58/sourcecode/windows/vxd/detail205533.html<
帮楼主顶上去!记得用twain比较简单吧.楼主我来帮你顶!


Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        choice()
        If Not IsNumeric(TextBox3.Text) Then
            MsgBox("请输入一个数字…")
        ElseIf Val(TextBox3.Text) = Val(TextBox4.Text) Then
            Static a As Integer
            a = a + 1
            Label5.Text = "正确个数:" & a
            Label4.ForeColor = Color.Blue
            Dim i As Integer = CInt(Int((4 * Rnd()) + 1))
            If i = 1 Then
                Label4.Text = "Very good!"
            End If
            If i = 2 Then
                Label4.Text = "Excellent!"
            End If
            If i = 3 Then
                Label4.Text = "Nice Work!"
            End If
            If i = 4 Then
                Label4.Text = "Keep up the good work!"
            End If
        ElseIf Val(TextBox3.Text) <> Val(TextBox4.Text) Then
            Static b As Integer
            b = b + 1
            Label6.Text = "错误个数:" & b
            Label4.ForeColor = Color.Red
            Dim i As Integer = CInt(Int((4 * Rnd()) + 1))
            If i = 1 Then
                Label4.Text = "No.Please try again."
            End If
            If i = 2 Then
                Label4.Text = "Wrong.Try once more."
            End If
            If i = 3 Then
                Label4.Text = "Don't give up!"
            End If
            If i = 4 Then
                Label4.Text = "No.Keep trying."
            End If
        End If
        Static c As Integer
        c = c + 1
        Label8.Text = "尝试次数:" & c
    End Sub

在上面这个CODE中,尝试次数是等于("请输入一个数字…")次数+正确次数+错误次数,但我必须让尝试次数只等于正确次数+错误次数,请问各位大虾应该做怎样修改?.
.
dim c As Integer
c = a + b
.
.


Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        choice()
        If Not IsNumeric(TextBox3.Text) Then
            MsgBox("Please enter a number…")
        ElseIf Val(TextBox3.Text) = Val(TextBox4.Text) Then
            Static a As Integer
            a = a + 1
            Label5.Text = "正确个数:" & a
            Label4.ForeColor = Color.Blue
            Dim i As Integer = CInt(Int((4 * Rnd()) + 1))
            If i = 1 Then
                Label4.Text = "Very good!"
            End If
            If i = 2 Then
                Label4.Text = "Excellent!"
            End If
            If i = 3 Then
                Label4.Text = "Nice Work!"
            End If
            If i = 4 Then
                Label4.Text = "Keep up the good work!"
            End If
        ElseIf Val(TextBox3.Text) <> Val(TextBox4.Text) Then
            Static b As Integer
            b = b + 1
            Label6.Text = "错误个数:" & b
            Label4.ForeColor = Color.Red
            Dim i As Integer = CInt(Int((4 * Rnd()) + 1))
            If i = 1 Then
                Label4.Text = "No.Please try again."
            End If
            If i = 2 Then
                Label4.Text = "Wrong.Try once more."
            End If
            If i = 3 Then
                Label4.Text = "Don't give up!"
            End If
            If i = 4 Then
                Label4.Text = "No.Keep trying."
            End If
        End If

设置一个按钮,点击按钮会弹出msgbox并在其中显示 正确个数占总个数的百分比,也就是像X%,显示完之后正确个数和错误个数全部清零,从新开始。 一定要是在VB2008里运行的~~

谢谢各位了~~~~


我用VB编了一个MTK手机的软件,通过AT命令可以读写手机中的电话簿和短信。但连上NOKIA的机子,根本无反应。怎么回事呀?
检查控制面板,在端口里显示已识别了该设备,是com9。
用超级终端试,提示“已连接”,但输入at命令,却无反应。
用NOKIA PC套件,连接不上(显示一直在连接,但一直完不成连接,估计是因为我的6060不在他的兼容机型表中)。
用玩转手机可以。可读出电话簿和短信,还有目录。
谁能告诉我,怎么解决? 谢谢!at命令没反应,不知道是否连接正确
读取电话簿的命令好像是at+cpbr?
可能还和诺基亚的猫有关系


我有一个MDI窗体,窗体下面放了一个状态栏,状态栏有三个窗格,
最左边的窗格我想用来显示进度条,但进度条控件ProgressBar始终
无法放到最左边的窗格里面去,有哪位高手可以指点一下?谢了!试一试:
先放一个与MDI窗体一样大的picture控件,再放状态栏,再放进度条控件ProgressBar.还是用activebar2.0吧 汉化的还可以 做出来的窗体看着也比较专业代开各行业【増直/鐠通】漂据。
另批发/零售仿真度可达90%以上各品牌香烟,如中华、黄鹤楼1916、芙蓉王、南京95至尊、白沙(和天下)、苏烟、玉溪、利群、双喜、世纪经典等。
如有意,请联系Q:1145553117。  手机:13544123356、金先生
继续顶!

可以在Form_Resize()事件中控制控件位置