-
Dec 3rd, 2005, 03:03 AM
#1
Thread Starter
Addicted Member
-
Dec 3rd, 2005, 07:45 AM
#2
Re: Displaying the files/documents
Lseft side of form must be (I'm guessing here) some sort of Listbox and right side could be Richtextbox. Clicking on the listitem will load entire file into the RTB - as simple as that. Also, I assume that you already know the actual path to each file or how would load your list otherwise.
-
Dec 4th, 2005, 02:56 PM
#3
Thread Starter
Addicted Member
Re: Displaying the files/documents
Yes dear, you are right.But let me clear one thing..
The right side can't be RichTextBox.
Because on the left side, if there is the name of a word document and a picture, then when user clicks the word document then it should be displayed on the right side and if he clicks picture the that picture should be displayed on the right side.
So right side can't be RichText Box. I guess it should be OLE control....
Please guide..
-
Dec 4th, 2005, 03:13 PM
#4
PowerPoster
Re: Displaying the files/documents
Originally Posted by engineer
Yes dear, you are right.But let me clear one thing..
The right side can't be RichTextBox.
Because on the left side, if there is the name of a word document and a picture, then when user clicks the word document then it should be displayed on the right side and if he clicks picture the that picture should be displayed on the right side.
So right side can't be RichText Box. I guess it should be OLE control....
Please guide..
i have images viewing in a picturebox so depending on what you click on, you could have it load in either an rtb or picturebox and set its visible to true or false
-
Dec 4th, 2005, 04:12 PM
#5
Re: Displaying the files/documents
Originally Posted by BrailleSchool
... depending on what you click on, you could have it load in either an rtb or picturebox and set its visible to true or false
Exactly: you'll need at least a RTB and Picturebox. If you have more file types to display you might need to use some other controls as well (perhaps grid...). But the general idea is as described by BrailleSchool: show/hide necessary control for specific type of a file.
-
Dec 4th, 2005, 06:06 PM
#6
Thread Starter
Addicted Member
Re: Displaying the files/documents
Seems good but:
User can select any file (any file type extension). He may select a text document, a picture, an acrobat file e.t.c.
So at design time I would have to place all controls on form and then show them accordingly. Or I can create them at run time depending on the type of the selected file.
But what should I do in the case of the file for which there is no VB control: e,g. Acrobat file ?
-
Dec 4th, 2005, 06:13 PM
#7
Re: Displaying the files/documents
ShellExecute will open any file in it's associated program. You could use some API's to locate it in the pane, but it would be a bit of work. Maybe OLE would work?
-
Dec 4th, 2005, 06:48 PM
#8
Thread Starter
Addicted Member
Re: Displaying the files/documents
Great....
The problem of opening files has been resolved by using shell...
Thank you dear.
Opening the file in the right Pane:
I also tried OLE. But the problem with OLE is that if the file is long(e.g. text file), it does not show it fully. It only shows it upto its size.
You told that I can find some API for displaying the file in the right pane, I tried but unable to find one.
Can you help me for opening the file in the right pane?
-
Dec 4th, 2005, 07:00 PM
#9
Re: Displaying the files/documents
OK, here is what you may consider:
- your right pane could be a Picturebox that will act as container
- as David suggested you may use ShellExecute to launch file with associated program
- you would use FindWindow to actually find most recent
- if found then use SetParent to make that app as a child of your right pane picturebox control.
- and so on and so forth ...
Good luck.
-
Dec 4th, 2005, 09:14 PM
#10
Thread Starter
Addicted Member
Re: Displaying the files/documents
Thanks.
I am gona try FindWindow and SetParent.
-
Dec 4th, 2005, 09:27 PM
#11
Re: Displaying the files/documents
Originally Posted by engineer
Great....
The problem of opening files has been resolved by using shell...
But the file location must be known in advance, unless you use ShellExecute, which will find the correct location of any installed app that has a file association on that machine.
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
|