树形控件treeview,知道node.key,如何删除,该节点?还有其他问题

lubberland 2003-10-14 05:37:18
问题2:
知道错误号,如何得到错误描述,window的错误号范围是多少,自定义一般为多少?
问题3:
我编的com+组件,如何多机部署,完成事务均衡功能?com+还必须读一些其他的dll.
问题4:
知道text控件的名称(“aaa”),为字符串,如何根据该字符串,得到aaa.text?
(因为该text是vb中生成的,可能为数组)
...全文
80 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
cloudtarget 2004-02-07
  • 打赏
  • 举报
回复
treeview1.Nodes.Remove (treeview1.SelectedItem.Index)
lubberland 2003-10-17
  • 打赏
  • 举报
回复
是,选中控件,拖动(控件浮起)到制定位置。
planetike 2003-10-17
  • 打赏
  • 举报
回复
nodes.remove node.key
j4sxw 2003-10-17
  • 打赏
  • 举报
回复
UP
rainstormmaster 2003-10-15
  • 打赏
  • 举报
回复
//如何做控件的移动(运行时)?
两个按钮,一个timer控件
Private Sub Command1_Click()
Me.Timer1.Enabled = True
End Sub

Private Sub Command2_Click()
Me.Timer1.Enabled = False
End Sub

Private Sub Form_Load()
Me.Timer1.Interval = 55
Me.Timer1.Enabled = False
End Sub

Private Sub Timer1_Timer()
Me.Command1.Move Me.Command1.Left + 10
End Sub

或者你指的是拖动控件?
lubberland 2003-10-15
  • 打赏
  • 举报
回复
是标准dll。
先回答“如何多机部署,完成事务均衡功能?”问题,我知道能做,但不知道怎样部署。
问题1,4 可结贴了,谢谢各位。

再问:
如何做控件的移动(运行时)?
easydone 2003-10-14
  • 打赏
  • 举报
回复
'我自己写的一个通用错误处理模块,用于处理各种异常。
'----------------------(3)----------------------------
Public Sub ErrHandle(Optional Obj As Form, Optional Des As String)
If Screen.MousePointer <> 0 Then
Screen.MousePointer = 0
End If
If (Not IsMissing(Obj)) And (Not Obj Is Nothing) Then
Obj.MousePointer = 0
End If
Select Case Err.Number '根据情况自己定。
Case 430
MsgBox "动态链接库(DLL)注册失败!", vbExclamation, "错误"
Case -2147024770
If Not IsMissing(Des) Then
MsgBox Des, vbCritical, "错误"
Else
MsgBox "系统文件丢失!请求的功能无法完成。", vbCritical, "错误"
End If
Case -2147467259
MsgBox "与数据库的连接中断!请退出本系统,并检查数据库的可访问性。", vbExclamation, "连接中断"
Case 481
MsgBox "这是系统不支持的照片文件格式!", vbOKOnly, "格式不支持"
Case 70
MsgBox "系统无法进行正常的文件操作!若正在进行打印,请在打印完成后再试。", vbExclamation, "错误"
'-----------------------------打印错误---------------------------------------------
Case -2147417848
MsgBox "系统无法正常调用外部打印程序!(Excel自动化错误,请稍候再试。)", vbExclamation, "错误"
Case -2147417851
MsgBox "系统无法正常调用外部打印程序!(Excel自动化错误,请稍候再试。)", vbExclamation, "错误"
Case 462
MsgBox "系统无法正常调用外部打印程序!(Excel自动化错误,请稍候再试。)", vbExclamation, "错误"
Case 91
MsgBox "系统无法正常调用外部打印程序!(Excel自动化错误,请稍候再试。)", vbExclamation, "错误"
Case 429
MsgBox "系统无法正常调用外部打印程序!(Excel自动化错误,请稍候再试。)", vbExclamation, "错误"
'--------------------------------------------------------------------------
Case Else
MsgBox "系统在运行时发现异常!" + Chr(13) + Chr(10) + "异常来源:" + _
Err.Source + Chr(13) + Chr(10) + "异常描述:" + Err.Description
End Select
ErrorInfo "错误:" + CStr(Err.Number) + "----" + Err.Source + "----" + Err.Description
End Sub
knikcn 2003-10-14
  • 打赏
  • 举报
回复
关注这个问题?
UP
rainstormmaster 2003-10-14
  • 打赏
  • 举报
回复
1
Private Sub Command1_Click()
Dim mnode As Node
For Each mnode In Me.TreeView1.Nodes
If mnode.Key = "C31" Then
Me.TreeView1.Nodes.Remove mnode.Index
Exit For
End If
Next

End Sub
4
一个textbox,一个按钮:
Private Sub Command1_Click()
MsgBox Me.Controls("text1").Text
End Sub

3.
//我编的com+组件,如何多机部署,完成事务均衡功能?com+还必须读一些其他的dll

是标准的dll吗?
xiaobird1 2003-10-14
  • 打赏
  • 举报
回复
4、我也关注过。

转贴
http://expert.csdn.net/Expert/topic/2332/2332339.xml?temp=.7909357
online 2003-10-14
  • 打赏
  • 举报
回复
1.
Private Sub DeleteCodeItem()
On Error GoTo vbErrorHandler
Dim sKey As String
Dim oNode As Node
Dim sMessage As String
Dim oParentNode As Node

Set oNode = tvCodeItems.SelectedItem
sKey = oNode.Key
If sKey = "ROOT" Then Exit Sub
If oNode Is Nothing Then
MsgBox "No Selected Record", , App.ProductName
Exit Sub
End If
sMessage = "Delete selected Code "
If oNode.Children > 0 Then
sMessage = sMessage & "and all child records ?"
Else
sMessage = sMessage & "?"
End If
If MsgBox(sMessage, vbYesNo + vbExclamation, "Delete Code Record") = vbNo Then
Exit Sub
End If
Set oParentNode = oNode.Parent
tvCodeItems.Nodes.Remove sKey
If oParentNode.Children = 0 Then
oParentNode.Expanded = False
If Not oParentNode.Key = "ROOT" Then
oParentNode.Image = "CHILD"
End If
End If
Exit Sub
vbErrorHandler:
MsgBox Err.Number & " " & Err.Description & " " & Err.Source & "
End Sub

7,789

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧