Private Sub SaveToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click Dim sdlg As New SaveFileDialog() With sdlg .Title = "Export Image File" .Filter="jpg|*.jpg|gif|*.gif|tga|*.tga|bmp|*.bmp|raw|*.raw|emf|*.emf|wmf|*.wmf|png|*.png|cdr|*.cdr|wpg|*.wpg|wmz|*.wmz|tif|*.tif|pcz|*.pcz" End With If sdlg.ShowDialog = Windows.Forms.DialogResult.OK Then Select Case sdlg.FilterIndex 'Because the base for FilterIndex is 1 not 0 Case 1 Me.PictureBox1.Image.Save(sdlg.FileName,ImageFormat.Jpeg) Case 2 Me.PictureBox1.Image.Save(sdlg.FileName, ImageFormat.Gif) Case 3 Me.PictureBox1.Image.Save(sdlg.FileName, ImageFormat.Bmp) Case 4 Me.PictureBox1.Image.Save(sdlg.FileName, ImageFormat.Png) Case 5 Me.PictureBox1.Image.Save(sdlg.FileName,ImageFormat.Icon) Case 6 Me.PictureBox1.Image.Save(sdlg.FileName,ImageFormat.Tiff) Case 7 Me.PictureBox1.Image.Save(sdlg.FileName, ImageFormat.Wmf) Case 8 Me.PictureBox1.Image.Save(sdlg.FileName,ImageFormat.Exif) Case 9 Me.PictureBox1.Image.Save(sdlg.FileName, ImageFormat.Emf) End Select End If End Sub
I have two forms Form1(MDI Form) and Form2 which has picturebox on it.
Form1 contains a ToolStripMenu and ToolStripBar.File menu has two sub menus Open and Exit and similarly Toolbar has two buttons Open and save, OpenDialogue is on the Form1
Form2 contains ToolStripMenu and ToolStripBar.File menu has a sub menus Save and and similarly Toolbar has one button save, SaveDialogue is on the Form2
Above code works fine for save menu and save button on form2 but it does not work for save button on Form1,plz tell me that how can do that to save properly through save button on form1.
Similarly I have another problem concern to merging menus and toolbar buttons
Before loading the image I need only two sub menus open and exit and one button open on toolbar on form1 because I have nothing to save
But after when I load the image I need save sub menu and save button, I want to merge them with each other, when image loaded there should be only one menu on form1 and form2’s save menu should merge into File menu of form1 and file menu of form2 should disappear from there.
Similarly I want to do that with save button on form2 that it should merge with open button on form2 and save button and toolbar should disappear from form2.
Plz kindly tell me how can I do that in Visual Basic.net 2005
thanks

New Topic/Question
Reply




MultiQuote




|