Lost Password?

Go Back   CodeCall Programming Forum > Software Development > Visual Basic Programming

Visual Basic Programming Discussion forum for Visual Basic, an event driven programming language and associated development environment from Microsoft for its COM programming model.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-21-2007, 01:31 AM
blueparukia blueparukia is offline
Newbie
 
Join Date: Aug 2007
Posts: 3
Rep Power: 0
blueparukia is on a distinguished road
Default Creating an image viewer in Visual Basic

Now, basically, I want to make a VB program that can recognise custom file types (not really custom, more on that later).

Basically, there are 2 crucial elements I am missing.

1. The ability to view images. Using Microsoft VB6, what type of object do I want to add for the images to display in, and what code do I need?

2. Reading a semi-custom file extension. Say I have renamed a file from: image.png to image.dgn for example. It is still a png image, but has a different name. So when you press cmd_open I need it to browse only for files that have the .dgn/.dgnet extension, and open them as .pngs.

I haven't used VB for 3 years now, and am VERY rusty. I can't even remember how to make a browser box to open files


Can someone provide me with code to do this, I hope to get back into learning VB one day.

Thanks,

BP
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 08-21-2007, 04:38 AM
TcM's Avatar   
TcM TcM is offline
Moderator
 
Join Date: Aug 2006
Location: In a technologic world :p
Posts: 7,327
Rep Power: 66
TcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud ofTcM has much to be proud of
Default

Well you have to use the picture box object, and as for the code it depends on how you plan to open the image.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-21-2007, 05:17 AM
blueparukia blueparukia is offline
Newbie
 
Join Date: Aug 2007
Posts: 3
Rep Power: 0
blueparukia is on a distinguished road
Default

Well, press a comand button "Open" (cmd_open) and you jsut chose a file like in most programs when you open a file.


BP
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-06-2007, 12:35 PM
o0TheNerd0o's Avatar   
o0TheNerd0o o0TheNerd0o is offline
Learning Programmer
 
Join Date: Sep 2007
Location: I.E. So-cal
Age: 22
Posts: 61
Rep Power: 4
o0TheNerd0o is on a distinguished road
Send a message via AIM to o0TheNerd0o
Default

Just make a PictureBox and CommandButton object. Then put this code into Command1_Click()

Picture1.Picture = LoadPicture(app.path & "\picture.dgn")

I tested in VB6, works fine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-10-2007, 02:00 AM
blueparukia blueparukia is offline
Newbie
 
Join Date: Aug 2007
Posts: 3
Rep Power: 0
blueparukia is on a distinguished road
Default

I did it with Common Dialog


Thanks for your help,

BP
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Contest: C# vs. Java vs. Visual Basic Jordan General Programming 184 09-03-2008 11:04 AM
For the novice in visual basic littlefranciscan Visual Basic Programming 2 02-06-2007 08:30 PM
Visual Studio 2005 and Windows Vista Jordan General Programming 3 01-22-2007 03:21 PM
Graphical programming add-in for Visual Basic 6.0 xXHalfSliceXx Visual Basic Programming 10 01-03-2007 07:14 AM
Parallel Port Programming Using Visual Basic kevintcp85 Visual Basic Programming 12 12-06-2006 12:09 PM


All times are GMT -5. The time now is 12:38 AM.

Contest Stats

John ........ 223.00000
dargueta ........ 168.00000
Xav ........ 164.00000
LogicKills ........ 20.00000
gaylo565 ........ 18.00000
WingedPanther ........ 15.00000
|pH| ........ 15.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 67%

Ads