-
Problem with Handling Rich Text Box Control in VB 6.0
Hi all,
I have problem with RichTextBox control in vb 6.0I need to drag text/picture/mail message files
& drop them onto richtextbox.When user double clicks on that file in richtextbox the corresponding file should open
(as the richtextbox control may contain multiple files dropped on it).Is there any way to do this in vb 6?
1.I set OLEDropMode property to rtfOLEDropAutomatic,OLEDragMode property to rtfOLEDragAutomatic.
Then when I dropped text file into RichTextBox control, it displays file name in richtextbox
When I double clicked on the text file it is not displayed but only shows some window in taskbar for a moment
and the window gets closed.Nothing happens ,file not displayed.
When I set OLEDragMode property to rtfOLEDragAutomatic and OLEDropMode property to rtfOLEDropManual ,I can catch OLEDragDrop event but when I dragged a text file into RichTextBox control file name is not shown in richtextbox control.
Thanks
-Kiran
-
Welcome to DevX 
Post the code that you are using.
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
Hi,
Here is my code
I used RichTextBox control as RichTextBox1
I set OLEDropMode property to rtfOLEDropManual.
I set OLEDragMode property to rtfOLEDragManual.
How I show Text file in a RichTextBox control ?
How I open Text file On double click ?
Is there any other way to handle drag drop events programmatically in vb6?
Code:
Private Sub RichTextBox1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
RichTextBox1.OLEDrag
End Sub
Private Sub RichTextBox1_OLEDragDrop(Data As RichTextLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
RichTextBox1.Text = Data.Files(1)
End Sub
Private Sub RichTextBox1_OLEDragOver(Data As RichTextLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single, State As Integer)
If Data.GetFormat(vbCFFiles) Then
RichTextBox1.OLEDropMode = vbOLEDropManual
End If
End Sub
Private Sub RichTextBox1_OLEStartDrag(Data As RichTextLib.DataObject, AllowedEffects As Long)
AllowedEffects = vbDropEffectCopy
Data.Clear
Data.SetData RichTextBox1., vbCFFiles
End Sub
Last edited by Hack; 10-29-2007 at 07:10 AM.
Reason: Added Code Tags
-
Do you want to open it in like Notepad or display the contents in another RTB?
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
hello
I want to open the text file when user clicks on the text file draged & droped onto richtextbox.On some machine it is opened but on other it is not.
why so? how to resolve it,pls help
thanks
-
I mean ,for text file display in Notepad,for paint display it in mspaint
-
 Originally Posted by kiran.mate
I want to open the text file when user clicks on the text file draged & droped onto richtextbox.On some machine it is opened but on other it is not.
This concerns me. In situations like this, it generally is not the fault of the code, but something wrong with the machine.
How are the machines that it does not work on different from the machines that it does work on?
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
The m/c on which it worked is having vb 6 sp6 on other m/c no sp6.So I installed sp6 on non working 3 m/c.Now on One of 3 non working m/c,it worked ,prompted me for open file dlg(packager window) when I dbl click on file but rest of 2 m/c still same behavior.
I finally set richtextbox OLEDropMode Manual,catched OLEDragDrop event & in that event written below code
Richtextbox1.OLEObjects.add ,,data.files(1)
Now I'm able to catch OLEDragDrop as well as Dropped text/paint files r shown in richtextbox.But with above code ,when I DragDrop text file it is opened automatically,When I dragDrop Paint file it is activated in richtextbox itself.I don't want to display/activate the file dragdropped on richtextbox.I want it to be opened only when user dbl clicks on the file name in richtextbox.
Is there any way to avoid automatic display/activation of file dragdropped on richtextbox
thanks
-
You must have some programming code that opens it right?
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
Similar Threads
-
By chupacabra in forum VB Classic
Replies: 5
Last Post: 06-18-2007, 12:13 PM
-
Replies: 0
Last Post: 08-28-2003, 11:15 PM
-
Replies: 3
Last Post: 08-30-2001, 11:45 AM
-
By Mark Alexander Bertenshaw in forum VB Classic
Replies: 16
Last Post: 08-08-2001, 07:35 PM
-
By Glenn in forum ASP.NET
Replies: 0
Last Post: 12-13-2000, 07:55 AM
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks