Hi,
I new to VB, and have a question. If start an application by dropping a file or files on the icon of the program created in VB, how do I access these files inside the application?
Best regards,
Adam Ek
Printable View
Hi,
I new to VB, and have a question. If start an application by dropping a file or files on the icon of the program created in VB, how do I access these files inside the application?
Best regards,
Adam Ek
The command line arguments are stored in the Command$ variable
VB Code:
Private Sub Command1_Click() 'Display the command line arguments MsgBox Command$ End Sub
Did you want to include drag and drop? Set OLEDropMode of a textbox to Manual, Multiline to True and use this codeVB Code:
Private Sub Text1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single) Dim intFF As Long intFF = FreeFile Open Data.Files(1) For Input As #intFF Text1.Text = Input(LOF(intFF), #intFF) Close #intFF End Sub
How can I modified that code to be able to paste picture in a rtb1.
This is what I made to change the TEXT1 >> RTB!
VB Code:
'Chrishjk code Private Sub rtb1_OLEDragDrop(Data As RichTextLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single) Dim intFF As Long intFF = FreeFile Open Data.Files(1) For Input As #intFF rtb1.Text = Input(LOF(intFF), #intFF) Close #intFF End Sub
When I drop image it give me an error How can I stop taht error by simply put the picture in ?
I wouldn't expect that to work for pictures (being .Text and all)
This might work
VB Code:
Private Sub RichTextBox1_OLEDragDrop(Data As RichTextLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single) RichTextBox1.OLEObjects.Add , , Data.Files(1) End Sub
Thank you,
Daok