Click here to Skip to main content
16,020,669 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In VB6.0, I've a picture box, in that picture box I've put Label control array . I want to capture the Image of Picture box containing the label also.

Following is the code: Contains a PictureBox and Label Control array, I'm trying.
Please help me out. Thanks in advance.

VB
Dim arrparaName(9) As String
Dim arrparaValue(9) As String
Dim i As Integer
Dim heightOfAllLabel As Integer
Private Sub Form_Load()
    arrparaName(0) = "Roundness"
    arrparaValue(0) = "0.158" & Chr(230)
    arrparaName(1) = "[LSC]& Gaussian"
    arrparaValue(1) = "1-50 UPR"
    arrparaName(2) = "Datum"
    arrparaValue(2) = "Spindle"
    arrparaName(3) = "Peak"
    arrparaValue(3) = "0.087" & Chr(230)
    arrparaName(4) = "Vally"
    arrparaValue(4) = "0.071" & Chr(230)
    arrparaName(5) = "Runout"
    arrparaValue(5) = "0.66" & Chr(230)
    arrparaName(6) = "Eccentricity"
    arrparaValue(6) = "0.289" & Chr(230)
    arrparaName(7) = "Concentricity"
    arrparaValue(7) = "0.578" & Chr(230)
    arrparaName(8) = "EccenAngle"
    arrparaValue(8) = "79.317" & Chr(167)
    arrparaName(9) = "Probe Layout"
    arrparaValue(9) = "N.A."
    
    lblParaName(0).Caption = arrparaName(0)
    lblParaValue(0).Caption = arrparaValue(0)
    heightOfAllLabel = heightOfAllLabel + lblParaName(0).Height
    For i = 1 To 9
        Load lblParaName(i)
        With lblParaName(i)
            .Visible = True
            .Caption = arrparaName(i)
            .Top = lblParaName(i - 1).Top + lblParaName(i - 1).Height
        End With
        
        Load lblParaValue(i)
        With lblParaValue(i)
            .Visible = True
            .Caption = arrparaValue(i)
            .Top = lblParaValue(i - 1).Top + lblParaValue(i - 1).Height
        End With
        heightOfAllLabel = heightOfAllLabel + lblParaName(i).Height
    Next i
    'Picture1.Height = heightOfAllLabel + 240
    

    Picture1.CurrentX = 300
    Picture1.CurrentY = heightOfAllLabel + 300
    Picture1.FontSize = 5
    Picture1.Print Picture1.FontSize
    Picture1.AutoRedraw = True
    SavePicture Picture1.Image, App.Path & "\Para.bmp"

End Sub
Posted
Updated 30-Aug-10 23:55pm
v2
Comments
Christian Graus 31-Aug-10 3:55am    
Why are people using VB6 when it's obsolete and it sucks ?
Sergey Alexandrovich Kryukov 13-Feb-13 17:39pm    
Yes...
Take a look at this and some reaction:
http://www.codeproject.com/Answers/545172/VB6plusActiveXplusDLLplusProblem#answer1
By the way, I credited your past comment...
—SA
Kunal Chowdhury «IN» 31-Aug-10 5:55am    
May be they don't want to upgrade their application... with the latest technologies... ;)
Christian Graus 31-Aug-10 5:57am    
For a decade ?
CPallini 31-Aug-10 6:47am    
You have 1 picture box and 1 array of labels. What do you want to do? Do you want to capture the intersection between the picture and a particular label?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900