1,105,592 Community Members

Browse button in vb 6.0

Member Avatar
kartouss
Junior Poster in Training
80 posts since Jan 2008
Reputation Points: 2 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hello,
I need to a browse button to be able to open an image in the image control and also be able to get the path for the image...
Can anyone help...

Member Avatar
choudhuryshouvi
Posting Pro
556 posts since May 2007
Reputation Points: 33 [?]
Q&As Helped to Solve: 50 [?]
Skill Endorsements: 0 [?]
 
0
 

Hello,
I need to a browse button to be able to open an image in the image control and also be able to get the path for the image...
Can anyone help...

Check out this sample project. look the screenshot also.
and tell me what do you think about it.

regards
Shouvik

Attachments Windows_Picture_Viewer.zip (2.95KB) Screenshot.JPG 49.78KB
Member Avatar
kartouss
Junior Poster in Training
80 posts since Jan 2008
Reputation Points: 2 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hello,
The form you sent thats fine maybe i will use it to display the images from different directories..
Anyway i have found a code for the browse button...

Option Explicit
'Add a CommonDialog control to your form.
'Project > Components > Controls tab > "Microsoft Common Dialog control" > OK
Private Sub Command1_Click()
    On Error GoTo MyError
    With CommonDialog1
        .CancelError = True
        .DialogTitle = "Common Dialog Example"
        .Filter = "Text files only (*.txt)|*.txt|All files (*.*)|*.*"
        .FilterIndex = 1
        .Flags = cdlOFNHideReadOnly Or cdlOFNOverwritePrompt Or cdlOFNPathMustExist
        .InitDir = App.Path
        .ShowSave
    End With
    'Do your save stuff here
    'Use the CommonDialog1.FileName property to get the full path and file name selected
    '
    Exit Sub
MyError:
    If Err.Number <> cdlCancel Then
        MsgBox Err.Number & " - " & Err.Description, vbOKOnly + vbExclamation, "Save"
    End If
End Sub

Now i want to display the path in a textbox...
Can anyone help how we can get the path...
That is when i have selected a file form a directory, the path should be displayed automatically in a text box..

Member Avatar
kartouss
Junior Poster in Training
80 posts since Jan 2008
Reputation Points: 2 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hello,
I managed to solve the problem...
I use

Text1.Text = CommonDialog1.FileName

and that solved the problem...

Question Answered as of 6 Years Ago by choudhuryshouvi
Member Avatar
chrisjake
Newbie Poster
2 posts since Mar 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I'm

Member Avatar
chrisjake
Newbie Poster
2 posts since Mar 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I'm doing a data entry program that allows to enter the name, address, contact number, organization, pecinct number, and also a picture.
The problem is.

I need a browse button for picture that will enter into a picture box control or image box control

and also to input the picture into a database (MS Access)

and also retrieve the picture back to the picture box control

or image control

the output of the program is like an Identification Card

containing the picture, name, address, etc.

My connection into the database is OLEDB.

I'm also using Adodc as my data input and data retrieve.

I hope guys that you can help me about this

Thank you very much ^_^

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article