- 超级版主
- 1228894
- 26989
- 25
- 8064 朵
- 36143 个
- 4760 个
- 421340
- 2012-07-18
|
1#
t
T
发表于 2022-07-24 18:40
|
|只看楼主
功能一:[保存列表框内容]效果一览:代码一览:
- Event Form1.LoadOver
- Form1.Button1.Caption = "添加"
- Form1.Button2.Caption = "清空"
- Form1.ListBox1.List = ""
- Text = Plugin.File.ReadFileEx("C:\111.txt")
- MyArray = Split(Text, "|")
- For i = 0 To UBound(MyArray) - 1
- Var1 = MyArray(i)
- TracePrint var1
- Form1.ListBox1.AddItem Var1
- Next
- End Event
- //从输入框中获取文本内容,添加到列表框中。
- Event Form1.Button1.Click
- If Form1.InputBox1.Text <> "" Then
- Form1.ListBox1.AddItem Form1.InputBox1.Text
- End If
- Call Plugin.File.WriteFileEx("C:\111.txt", Form1.InputBox1.Text)
- End Event
- Event Form1.Button2.Click
- Form1.ListBox1.List = ""
- Call Plugin.File.DeleteFile("C:\111.txt")
- End Event
复制代码 功能二:[老式任务选择界面] 效果一览:
代码一览:
- Event Form1.LoadOver
- Form1.Button1.Caption = "添加"
- Form1.Button2.Caption = "清空"
- Form1.ListBox1.List = ""
- Form1.ListBox2.List ="A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z"
- Text = Plugin.File.ReadFileEx("D:\Config.txt")
- MyArray = Split(Text, "|")
- For i = 0 To UBound(MyArray) - 1
- Var1=MyArray(i)
- Form1.ListBox1.AddItem Var1
- Next
- End Event
- //从输入框中获取文本内容,添加到列表框中。
- Event Form1.Button1.Click
- Var1 = Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z")
- Var3 = Var1(Form1.ListBox2.ListIndex)
- Form1.ListBox1.AddItem Var3
- Call Plugin.File.WriteFileEx("D:\Config.txt", Var3)
- 'Msgbox "向目标文件写入文本内容"
- End Event
- Event Form1.Button2.Click
- Form1.ListBox1.List = ""
- Call Plugin.File.DeleteFile("D:\Config.txt"
- End Event
复制代码 功能三:[新型任务选择界面]效果一览: 代码一览: Event Form1.ListBox1.DblClick Var1 = Form1.ListBox1.List Var2=Split(Var1,"|") If Instr(Var2(Form1.ListBox1.ListIndex), "√") > 0 Then Form1.ListBox1.InsertItem Replace(Var2(Form1.ListBox1.ListIndex),"√ ","") , Form1.ListBox1.ListIndex Form1.ListBox1.RemoveItem Form1.ListBox1.ListIndex Else Form1.ListBox1.InsertItem "√ " & Var2(Form1.ListBox1.ListIndex), Form1.ListBox1.ListIndex Form1.ListBox1.RemoveItem Form1.ListBox1.ListIndex End If End Event Event Form1.Button1.Click If Form1.ListBox1.ListIndex <> 0 Then Var1 = Form1.ListBox1.List Var2=Split(Var1,"|") Form1.ListBox1.InsertItem Var2(Form1.ListBox1.ListIndex) , Form1.ListBox1.ListIndex -1 Form1.ListBox1.RemoveItem Form1.ListBox1.ListIndex Else MessageBox "放开你的猪蹄,让我来" End If End Event Event Form1.Button2.Click Var1 = Form1.ListBox1.List Var2=Split(Var1,"|") If Form1.ListBox1.ListIndex <> UBound(Var2) Then Form1.ListBox1.InsertItem Var2(Form1.ListBox1.ListIndex + 1), Form1.ListBox1.ListIndex Form1.ListBox1.RemoveItem Form1.ListBox1.ListIndex + 1 Else MessageBox "放开那个鼠标,让我来" End If End Event 任务顺序 = Split(Form1.ListBox1.List, "|") For i = 0 To UBound(任务顺序) If instr(任务顺序(i), "√") > 0 Then TracePrint 任务顺序(i) '这里加case判断任务顺序(i)进行对应任务Call End If Next
|