Hi, I'm trying to hide 5 to 12 buttons on a form until a screenshot is saved to the clipboard. I have it set right now so the user clicks a button(btnSavePDF) and then whichever buttons are visible are made not visible. But I haven't a clue how to restore just those buttons. I'm trying to avoid restoring them all unless they were all originally visible. Please help.
Here is the code I have so far:
Private Sub btnSavePDF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSavePDF.Click
Try
If btnChange1.Visible = True Then btnChange1.Visible = False
If btnChange2.Visible = True Then btnChange2.Visible = False
If btnChange3.Visible = True Then btnChange3.Visible = False
If btnChange4.Visible = True Then btnChange4.Visible = False
If btnChange5.Visible = True Then btnChange5.Visible = False
If btnChange6.Visible = True Then btnChange6.Visible = False
If btnChange7.Visible = True Then btnChange7.Visible = False
btnNewSystem.Visible = False
btnOptional.Visible = False
btnPrint.Visible = False
btnSavePDF.Visible = False
btnRecalc.Visible = False
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
' Create a blank bitmap.
Dim bmpScreenshot As New Bitmap(850, 690, PixelFormat.Format32bppArgb)
' Create a graphics object from the bitmap.
Dim gfxScreenshot As Graphics = Graphics.FromImage(bmpScreenshot)
' Take a screenshot of frmReport.
gfxScreenshot.CopyFromScreen(frmMain.lblSizer.Left + 122, frmMain.lblSizer.Top + 24, _
0, 0, frmMain.lblSizer.Size, CopyPixelOperation.SourceCopy)
Clipboard.SetImage(bmpScreenshot)
' Restore buttons to their orginal state.
' uh ? Help...