Click here to Skip to main content
15,898,222 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen9-Dec-16 2:59
professionalEddy Vluggen9-Dec-16 2:59 
GeneralRe: Convert VB to C# Pin
Pavlex49-Dec-16 7:28
Pavlex49-Dec-16 7:28 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen9-Dec-16 7:58
professionalEddy Vluggen9-Dec-16 7:58 
QuestionEquals/Comparison of the two objects in which the property of the list(as object) Pin
Cvele12329-Nov-16 4:29
Cvele12329-Nov-16 4:29 
QuestionRe: Equals/Comparison of the two objects in which the property of the list(as object) Pin
ZurdoDev29-Nov-16 6:20
professionalZurdoDev29-Nov-16 6:20 
AnswerRe: Equals/Comparison of the two objects in which the property of the list(as object) Pin
Cvele12329-Nov-16 6:28
Cvele12329-Nov-16 6:28 
AnswerRe: Equals/Comparison of the two objects in which the property of the list(as object) Pin
Cvele1239-Dec-16 2:05
Cvele1239-Dec-16 2:05 
QuestionWhy the picture not save correctly if I change from button click to form load Pin
Munirah Malik28-Nov-16 15:46
Munirah Malik28-Nov-16 15:46 
Hi admin,
I tried changed this code. I change the system save picture on form load not on button click. but the result, picture not save correctly. only blank picture. can we save the picture on form load? I use vb6

Private Sub Form_Load()
Call Command1_Click
End Sub


Private Sub Command1_Click()
  SaveFormImageToFile frmSaveFormImageToFile, Picture1, "C:\Temp.bmp"
End Sub


Public Sub SaveFormImageToFile(ByRef ContainerForm As Form, ByRef PictureBoxControl As PictureBox, ByVal ImageFileName As String)
  Dim FormInsideWidth As Long
  Dim FormInsideHeight As Long
  Dim PictureBoxLeft As Long
  Dim PictureBoxTop As Long
  Dim PictureBoxWidth As Long
  Dim PictureBoxHeight As Long
  Dim FormAutoRedrawValue As Boolean
  
  With PictureBoxControl
    'Set PictureBox properties
    .Visible = False
    .AutoRedraw = True
    .Appearance = 0 ' Flat
    .AutoSize = False
    .BorderStyle = 0 'No border
    
    'Store PictureBox Original Size and location Values
    PictureBoxHeight = .Height: PictureBoxWidth = .Width: PictureBoxLeft = .Left: PictureBoxTop = .Top
    
    'Make PictureBox to size to inside of form.
    .Align = vbAlignTop: .Align = vbAlignLeft
    DoEvents
    
    FormInsideHeight = .Height: FormInsideWidth = .Width
    
    'Restore PictureBox Original Size and location Values
    .Align = vbAlignNone
    .Height = FormInsideHeight: .Width = FormInsideWidth: .Left = PictureBoxLeft: .Top = PictureBoxTop
    
    FormAutoRedrawValue = ContainerForm.AutoRedraw
    ContainerForm.AutoRedraw = False
    DoEvents
    
    'Copy Form Image to Picture Box
    BitBlt .hDC, 0, 0, FormInsideWidth / Screen.TwipsPerPixelX, FormInsideHeight / Screen.TwipsPerPixelY, ContainerForm.hDC, 0, 0, vbSrcCopy
    DoEvents
    SavePicture .Image, ImageFileName
    DoEvents
    
    ContainerForm.AutoRedraw = FormAutoRedrawValue
    DoEvents
  End With
End Sub

AnswerRe: Why the picture not save correctly if I change from button click to form load Pin
Peter Leow28-Nov-16 17:57
professionalPeter Leow28-Nov-16 17:57 
QuestionFolder traverse in vbscript Pin
Member 126754628-Nov-16 0:17
Member 126754628-Nov-16 0:17 
AnswerRe: Folder traverse in vbscript Pin
Richard MacCutchan28-Nov-16 0:39
mveRichard MacCutchan28-Nov-16 0:39 
GeneralRe: Folder traverse in vbscript Pin
Member 126754628-Nov-16 1:02
Member 126754628-Nov-16 1:02 
GeneralRe: Folder traverse in vbscript Pin
Richard MacCutchan28-Nov-16 1:19
mveRichard MacCutchan28-Nov-16 1:19 
GeneralRe: Folder traverse in vbscript Pin
Member 126754628-Nov-16 1:28
Member 126754628-Nov-16 1:28 
GeneralRe: Folder traverse in vbscript Pin
Tim Carmichael28-Nov-16 5:01
Tim Carmichael28-Nov-16 5:01 
GeneralRe: Folder traverse in vbscript Pin
Member 126754630-Nov-16 22:05
Member 126754630-Nov-16 22:05 
GeneralRe: Folder traverse in vbscript Pin
Richard MacCutchan28-Nov-16 6:34
mveRichard MacCutchan28-Nov-16 6:34 
GeneralRe: Folder traverse in vbscript Pin
Dave Kreskowiak28-Nov-16 8:56
mveDave Kreskowiak28-Nov-16 8:56 
GeneralRe: Folder traverse in vbscript Pin
Member 126754629-Nov-16 22:55
Member 126754629-Nov-16 22:55 
GeneralRe: Folder traverse in vbscript Pin
Dave Kreskowiak30-Nov-16 5:36
mveDave Kreskowiak30-Nov-16 5:36 
QuestionHelp Needed Again: Funny Effects about My.Settings Pin
Sonhospa26-Nov-16 2:49
Sonhospa26-Nov-16 2:49 
AnswerRe: Help Needed Again: Funny Effects about My.Settings Pin
Dave Kreskowiak26-Nov-16 8:33
mveDave Kreskowiak26-Nov-16 8:33 
NewsRe: Help Needed Again: Funny Effects about My.Settings Pin
Sonhospa27-Nov-16 1:09
Sonhospa27-Nov-16 1:09 
GeneralRe: Help Needed Again: Funny Effects about My.Settings Pin
Eddy Vluggen27-Nov-16 2:40
professionalEddy Vluggen27-Nov-16 2:40 
GeneralRe: Help Needed Again: Funny Effects about My.Settings Pin
Sonhospa27-Nov-16 10:08
Sonhospa27-Nov-16 10:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.