-
ThanX megatron, it all works now :)
And I have another question (two).
1. I remember a while ago, somebody asked about why when loading a text from a file, adds 2 pipes. The answer was to make the textboxes multiline.
It worked fine until I noticed that when I press Down, I can't see the text and I have to go up to see it again.
When users will use my app and that will accidently happen to them, it will be very confusing.
How can I fix this? By the way, I need to leave the textbox unlocked and Enabled.
2. How do I use a ToolBar?
Adding items to it, Adding to every item of it, a picture, and making it to do things accoarding to the pressed button?
-
for the 2 pipes, those are carriage returns, just do this
Code:
Private Sub Whatever_whatever()
'some code here
Text1 = Left$(Text1, Len(Text1) - 2)
End Sub
-
Make a Form with a Toolbar and an ImageList. Make sure that there are 4 images loaded in the ListImages.
Code:
Private Sub Form_Load()
'Set the keys
ImageList1.ListImages(1).Key = "One"
ImageList1.ListImages(2).Key = "Two"
ImageList1.ListImages(3).Key = "Three"
ImageList1.ListImages(4).Key = "Four"
'Load the images in the Toolbar
Toolbar1.ImageList = ImageList1
Toolbar1.Buttons.Add , "One", , , "One"
Toolbar1.Buttons.Add , "Two", , , "Two"
Toolbar1.Buttons.Add , "Three", , , "Three"
Toolbar1.Buttons.Add , "Four", , , "Four"
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "One"
'Button1 was clicked
Case "Two"
'Button2 was clicked
Case "Three"
'Button3 was clicked
Case "Four"
'Button4 was clicked
End Select
End Sub