|
-
Oct 14th, 2001, 01:13 PM
#1
Thread Starter
New Member
Newbie quetsion, startup arguments
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
-
Oct 14th, 2001, 01:17 PM
#2
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
-
Oct 14th, 2001, 01:39 PM
#3
PowerPoster
Did you want to include drag and drop? Set OLEDropMode of a textbox to Manual, Multiline to True and use this code
VB 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
-
Oct 14th, 2001, 01:46 PM
#4
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 ?
-
Oct 14th, 2001, 01:51 PM
#5
PowerPoster
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
-
Oct 14th, 2001, 01:55 PM
#6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|