Στο παρακάτω κώδικα χρησιμοποιούμε δυο ListBox στο ένα μπορούμε να γράφουμε. Όποια κύλιση κάνουμε στο ένα, γίνεται και στο άλλο! Το δεξί γράφει κιόλας! Το αριστερό με κλικ μεταφέρει το κείμενο του στοιχείου στο τίτλο του παραθύρου!
Declare Simple Form
With Simple, "Title" as myTitle$
Layer Simple {
Linespace 60
Font "Arial Black"
Window 16, 16000,6000
Cls 1,0
}
Declare ListBox1 Listbox Form Simple
Declare ListBox2 Listbox Form Simple
Method ListBox1, "move", 1000,1000,6000,2000
Method ListBox2, "move", 8000,1000,6000,2000
With Listbox1, "ScrollTo" as Scr1, "ScrollFrom" as Scr1Read, "ShowAlways", True, "List" as list$()
With Listbox2, "ScrollTo" as Scr2, "ScrollFrom" as Scr2Read, "Edit",true , "ShowAlways", True
With ListBox1,"Text", {Name
Address1
Address2
Address3
Info1
Info2
Info3
Info4
}
With ListBox2,"Text", {.
.
.
.
.
.
.
.
}
Method Simple, "Show"
Function Simple.Unload {
Keyboard "!"
}
Function Listbox2.Scroll {
scr1=scr2read
}
Function Listbox2.Click {
scr1=scr2read
}
Function Listbox1.Scroll {
Read New Where
myTitle$=List$(Where-1)
scr2=scr1read
}
Function Listbox1.Click {
Read New Where
myTitle$=List$(Where-1)
scr2=scr1read
}
Function Listbox2.Scroll {
scr1=scr2read
}
Function Listbox1.Scroll {
scr2=scr1read
}
Function Listbox2.Move {
read top1
scr1=top1
}
Function Listbox1.Move {
read top1
scr2=top1
}
a$=Key$ \\ no loop just wait a key, in console only
Declare Simple Nothing
Declare Simple Form
With Simple, "Title" as myTitle$
Layer Simple {
Linespace 60
Font "Arial Black"
Window 16, 16000,6000
Cls 1,0
}
Declare ListBox1 Listbox Form Simple
Declare ListBox2 Listbox Form Simple
Method ListBox1, "move", 1000,1000,6000,2000
Method ListBox2, "move", 8000,1000,6000,2000
With Listbox1, "ScrollTo" as Scr1, "ScrollFrom" as Scr1Read, "ShowAlways", True, "List" as list$()
With Listbox2, "ScrollTo" as Scr2, "ScrollFrom" as Scr2Read, "Edit",true , "ShowAlways", True
With ListBox1,"Text", {Name
Address1
Address2
Address3
Info1
Info2
Info3
Info4
}
With ListBox2,"Text", {.
.
.
.
.
.
.
.
}
Method Simple, "Show"
Function Simple.Unload {
Keyboard "!"
}
Function Listbox2.Scroll {
scr1=scr2read
}
Function Listbox2.Click {
scr1=scr2read
}
Function Listbox1.Scroll {
Read New Where
myTitle$=List$(Where-1)
scr2=scr1read
}
Function Listbox1.Click {
Read New Where
myTitle$=List$(Where-1)
scr2=scr1read
}
Function Listbox2.Scroll {
scr1=scr2read
}
Function Listbox1.Scroll {
scr2=scr1read
}
Function Listbox2.Move {
read top1
scr1=top1
}
Function Listbox1.Move {
read top1
scr2=top1
}
a$=Key$ \\ no loop just wait a key, in console only
Declare Simple Nothing
Δεν υπάρχουν σχόλια:
Δημοσίευση σχολίου
You can feel free to write any suggestion, or idea on the subject.