Picture1.Picture = LoadPicture(App.Path + "\a.jpg")

解决方案 »

  1.   

    把pufeng_999(小灰狼)给出的代码放到按钮的click事件里app.path是程序所在路径,如果程序在根目录下,后面的"\a.jpg"就该写成"a.jpg"
      

  2.   

    如果你对语言不懂的那么我贴代码也是白贴
    新建一个文本把以下内容贴进去然后把它改名为Form1.frm
    VERSION 5.00
    Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
    Begin VB.Form Form1 
       Caption         =   "Form1"
       ClientHeight    =   3195
       ClientLeft      =   60
       ClientTop       =   345
       ClientWidth     =   4680
       LinkTopic       =   "Form1"
       ScaleHeight     =   3195
       ScaleWidth      =   4680
       StartUpPosition =   3  '窗口缺省
       Begin MSComDlg.CommonDialog CommonDialog1 
          Left            =   465
          Top             =   2145
          _ExtentX        =   847
          _ExtentY        =   847
          _Version        =   393216
       End
       Begin VB.PictureBox Picture1 
          Height          =   1395
          Left            =   270
          ScaleHeight     =   1335
          ScaleWidth      =   4155
          TabIndex        =   1
          Top             =   270
          Width           =   4215
       End
       Begin VB.CommandButton Command1 
          Caption         =   "Command1"
          Height          =   495
          Left            =   1695
          TabIndex        =   0
          Top             =   2085
          Width           =   1215
       End
    End
    Attribute VB_Name = "Form1"
    Attribute VB_GlobalNameSpace = False
    Attribute VB_Creatable = False
    Attribute VB_PredeclaredId = True
    Attribute VB_Exposed = False
    Option ExplicitPrivate Sub Command1_Click()
    CommonDialog1.ShowOpen
    Picture1.Picture = LoadPicture(CommonDialog1.FileName)
    End Sub然后再新建一个文本把以下再贴,然后再改名为工程1.vbp
    Type=Exe
    Form=Form1.frm
    Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#D:\WINNT\System32\Stdole2.tlb#OLE Automation
    Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0; Comdlg32.ocx
    Startup="Form1"
    Command32=""
    Name="工程1"
    HelpContextID="0"
    CompatibleMode="0"
    MajorVer=1
    MinorVer=0
    RevisionVer=0
    AutoIncrementVer=0
    ServerSupportFiles=0
    CompilationType=0
    OptimizationType=0
    FavorPentiumPro(tm)=0
    CodeViewDebugInfo=0
    NoAliasing=0
    BoundsCheck=0
    OverflowCheck=0
    FlPointCheck=0
    FDIVCheck=0
    UnroundedFP=0
    StartMode=0
    Unattended=0
    Retained=0
    ThreadPerObject=0
    MaxNumberOfThreads=1[MS Transaction Server]
    AutoRefresh=1然后打开就是一个实例了~~~自己看着办吧
      

  3.   

    叶飞说的挺OK的了就是那么做啊Picture1.Picture = LoadPicture(App.Path + "\a.jpg")
    多用几次这个