OMG so simple yet so hard picturebox help
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
9 posts
Page 1 of 1
Okay I want to save an image from a webpage in a way like IE or chrome ect I have tried this code yet it does not work and I have no IDEA why
Code: Select all
Any help would be most aprechated Try
Dim pbx As New PictureBox
pbx.ImageLocation = ToolStrip1.Text
Dim sfd As New SaveFileDialog
sfd.Title = "Save your Image as...."
sfd.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyPictures
sfd.Filter = "Jpeg files (*.jpg)|*.jpg|Bitmap files (*.bmp)|*.bmp"
Dim result As DialogResult = sfd.ShowDialog
If result = Windows.Forms.DialogResult.OK Then
If sfd.FileName <> String.Empty Then
Dim MyImageFormat As System.Drawing.Imaging.ImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg
If sfd.FileName.ToString.ToUpper.EndsWith("JPG") Then
MyImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg
ElseIf sfd.FileName.ToString.ToUpper.EndsWith("BMP") Then
MyImageFormat = System.Drawing.Imaging.ImageFormat.Bmp
End If
pbx.Image.Save(sfd.FileName, MyImageFormat)
End If
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
If it is from internet then why not use my.computer.network.downloadfile(toolstrip.text, sfd.filename) ?
Mizzar I love you haha I had not thought of that needed a little tweaking but the compleat code is this if anyone else should need it
Code: Select all
Try
Dim label As New Label
label.Text = ToolStripStatusLabel1.Text
Dim sfd As New SaveFileDialog
sfd.Title = "Save your Image as...."
sfd.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyPictures
sfd.Filter = "Jpeg files (*.jpg)|*.jpg|Bitmap files (*.bmp)|*.bmp"
Dim result As DialogResult = sfd.ShowDialog
If result = Windows.Forms.DialogResult.OK Then
If sfd.FileName <> String.Empty Then
Dim MyImageFormat As System.Drawing.Imaging.ImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg
If sfd.FileName.ToString.ToUpper.EndsWith("JPG") Then
MyImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg
ElseIf sfd.FileName.ToString.ToUpper.EndsWith("BMP") Then
MyImageFormat = System.Drawing.Imaging.ImageFormat.Bmp
End If
My.Computer.Network.DownloadFile(label.Text, sfd.FileName)
End If
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
okay ones again needing help but does anyone know how to refresh the controls in a toolstrip I know
toolstrip.refresh
but that is not working the way I want I want to it remove all items and then put them all back again just I am loading items from a listbox
into a toolstrip that has to preset buttons and when I add a new one it is realoading the listbox items twise soo how can I fix this please
toolstrip.refresh
but that is not working the way I want I want to it remove all items and then put them all back again just I am loading items from a listbox
into a toolstrip that has to preset buttons and when I add a new one it is realoading the listbox items twise soo how can I fix this please
ToolStrip.Items.Clear() ?
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

Well i would use this but it will clear the 2 Buttons that i need to keep that are like allways there :P ?......
Code: Select all
Edit, this will remove every item in toolstrip except the one with text YOURBUTTON....for each tsi as toolstripitem in toostrip.items
if typeof tsi is toolstripbutton and tsi.text ="YOURBUTTONTOSTAY" then
else
toolstrip.items.remove(tsi)
end if
next
DeveloperJacomb I would use yours and it is amazing but tbh that would then just be copying and pasting most of what I need soo not doing it my self I mutch prefer giving it ago my self then asking you lot for help if I cant get it atleast that way it is my own or rather ours then just some random of the internet that I have changed the graphics of
9 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023