|
-
Jun 17th, 2010, 02:13 AM
#1
Thread Starter
Hyperactive Member
help about ms common dialog
all i want to know is how to use microsoft common dialog,so here is the scheme on what i want to make. check below
1.How to set a comman like when a user press the browse button a browse dialog will pop up and it has a open button and a cancel button and also user can only browse only a jpg and a jpeg file extension.
2.How to set a command,When the user click the jpg or jpeg file extension or in short a image then a user hit the open button the image that user select from the browse dialog should be in the Image Box.
3.How to set a command like when a user hit the save button, the image in Image Box should be save or atleast copy to the /Student Picture folder and rename as "MyDefaultPicture".
Thats all i want to know,Please help me.
Any help will appreciated. thanks
~[L!f3 !s @ll @ab0ut l3@rn!ng]~
~*D0nt Give up, h0pe is always present*~
-
Jun 17th, 2010, 02:22 AM
#2
-
Jun 17th, 2010, 03:48 AM
#3
Re: help about ms common dialog
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Jun 17th, 2010, 12:07 PM
#4
Thread Starter
Hyperactive Member
Re: help about ms common dialog
oh thanks koolsid such a sweet sample ..will now i want to make it simple like when a user hit the save button, the Picture in the ImageBox will be save automatically right after a user press the save button and the file will be named as what user put name on the filename.Text.So what command should i put?.
please help me.
~[L!f3 !s @ll @ab0ut l3@rn!ng]~
~*D0nt Give up, h0pe is always present*~
-
Jun 17th, 2010, 12:09 PM
#5
Re: help about ms common dialog
Show me the code that you have tried till now...
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Jun 17th, 2010, 12:22 PM
#6
Thread Starter
Hyperactive Member
Re: help about ms common dialog
Code:
Image1.Picture SavePicture("C:\")
but i got a error sayin' type mismatch' ..but honestly i dont know what command of it should i set. but im trying my best to make it. I want to save the image in the imagebox which came from d:\ that i browse using common dialog open window to c:\ and rename the file as "mypicture".
~[L!f3 !s @ll @ab0ut l3@rn!ng]~
~*D0nt Give up, h0pe is always present*~
-
Jun 17th, 2010, 12:35 PM
#7
Re: help about ms common dialog
Is this what you are trying?
Code:
'~~> ShowSave Example
Private Sub Command3_Click()
On Error GoTo cancel_error
With CommonDialog1
'~~> Set the Title of the Dialog Box
.DialogTitle = "Save"
'~~> Set the Initial directory
.InitDir = "C:\"
'~~> Set the Filter for the files that you want to save as
.Filter = "Image Files (*.bmp)|*.Bmp|All Files (*.*)|*.*"
'~~> Displays the Save Dialog Box
.ShowSave
End With
'~~> Save the Image1 Picture as bmp
SavePicture Image1.Picture, CommonDialog1.FileName
Exit Sub
cancel_error:
If Err.Number <> vbCancel Then
MsgBox Err.Description
End If
End Sub
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Jun 18th, 2010, 03:16 AM
#8
Thread Starter
Hyperactive Member
Re: help about ms common dialog
ok ,thanks , i got it , and in saving the picture method is i would not use common dialog as a saving function, thus i use a simple method such this
Code:
SavePicture Image1.Picture 'missing here,how can i specify the saving path of a image and the name of it'?
is there anyway to it as a .jpg file extension .. not bmp? .
THANKS AGAIN MR.KOOLSID
~[L!f3 !s @ll @ab0ut l3@rn!ng]~
~*D0nt Give up, h0pe is always present*~
-
Jun 18th, 2010, 03:53 AM
#9
Re: help about ms common dialog
Code:
SavePicture Image1.Picture, "C:\MyFile.Bmp"
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Jun 18th, 2010, 04:28 AM
#10
Re: help about ms common dialog
is there anyway to it as a .jpg file extension .. not bmp? .
THANKS AGAIN MR.KOOLSID
You can save the file with whatever name and extension. But the content will be the actual one. For example, if you are saving the BMP file in a JPG extension, it doesn't mean that you have converted the image to JPG format (compressed). The content will be same the BMP file. But some picture viewers are able to recognize the picture and they will open it for you, even it is in JPG extension.
So, technically, if you want to convert the picture to JPG format, you have to use some coding for the conversion.
That's what I think. Good luck...
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Jun 18th, 2010, 04:38 AM
#11
Re: help about ms common dialog
lolzzzz... I m missed that...
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Jun 18th, 2010, 04:50 AM
#12
Re: help about ms common dialog
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Jun 18th, 2010, 06:17 AM
#13
Re: help about ms common dialog
 Originally Posted by Condomx
is there anyway to it as a .jpg file extension .. not bmp? .
Do a search on here for BMP2JPEG.dll
Keith
I've been programming with VB for 25 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
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
|