Private Sub Command1_Click()
Text5 = Format(Val(Text4) * 196.72 * 35588 / 32909, "0")
Text6 = Format((Val(Text1) + Val(Text3)) * 1000 * 0.404 * 0.722 * 0.998 * 44 / 12 + Val(Text2) * 56, "0")
Text7 = Format(196.72 * Val(Text4) * 35588 / 32909 * 1064 / 1000, "0")
Text10 = Format((Val(Text1) + Val(Text3)) * 1000 * 0.404 * 0.9 * 0.0112 * 2 / 0.7143, "0")
Text11 = Format(196.72 * Val(Text4) * 35588 / 32909 * 0.857 / 1000, "0")
Text14 = Format((Val(Text1) + Val(Text3)) * 1000 * 0.0033 + Val(Text2) * 0.125, "0")
Text15 = Format(196.72 * Val(Text4) * 35588 / 32909 * 1.8 / 1000, "0")
Text18 = Format((Val(Text1) + Val(Text3)) * 1000 * 0.000036, "0")
Text8 = Format(Val(Text6) - Val(Text7), "0")
Text12 = Format(Val(Text10) - Val(Text11), "0")
Text16 = Format(Val(Text14) - Val(Text15), "0")
Text20 = Format(Val(Text18), "0")
Text9 = Format(Val(Text8) / Val(Text6), "0%")
Text13 = Format(Val(Text12) / Val(Text10), "0%")
Text17 = Format(Val(Text16) / Val(Text14), "0%")
Text21 = Format(Val(Text20) / Val(Text18), "0%")End Sub
Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
Text7 = ""
Text8 = ""
Text9 = ""
Text10 = ""
Text11 = ""
Text12 = ""
Text13 = ""
Text14 = ""
Text15 = ""
Text16 = ""
Text17 = ""
Text18 = ""
Text19 = ""
Text20 = ""
Text21 = ""
End Sub
Private Sub Command3_Click()
End
End Sub
其中将text6和text7,text10和text11,text14和text15,text18分别表示在四个柱状图中,四个控件的标题分别为二氧化碳排放量、二氧化硫排放量、氮氧化合物排放量、粉尘排放量,并且四个控件在同一个窗体中。另外,添加一个Command4按钮,其功能是:计算完成后,点击它,就可以直接出图。
希望大师给与帮助,谢谢,下周就要答辩了!谢谢

解决方案 »

  1.   

    您好,您能说的再详细一些吗,可以提供一下关于“计算结果”和“mschart控件”衔接的代码吗,谢谢
      

  2.   

    2种方法
    1、使用mschart控件可以让你把结果直接以图标方式输出在程序界面,但直接使用该控件导出为图片能不能实现就不知道,但第一个个功能是很容就实现了的,方法如下:
    text6和text7的值放在1个数组中
    text10和text11的值放在1个数组中
    text14和text15的值放在1个数组中
    text18的值放在1个数组中例如:
    dim test1(1)
    test(0)=text6
    test(1)=text7
    MSChart1.ChartData = test
    .....................
    依次类推
    要获取mschart的图片,可以用屏幕截图2、使用PICTUREBOX控件自己画,按照你自己的意图画出图形
    如果是4个图都要输出 可以使用4个PICTUREBOX控件 在控件中使用LINE命令画出来,例如:
    With Picture1
        .auturedraw=true
        .Line (500, 100)-(500, 2000)
        .Line (500, 2000)-(4000, 2000)
        .Line (800, 100)-(1000, 1980), vbRed, BF
        .Line (1200, 900)-(1400, 1980), vbGreen, BF
        .CurrentX = 850
        .CurrentY = 2200
        .Print "A"
        .CurrentX = 1250
        .CurrentY = 2200
        .Print "B"
    End With
    再用
    SavePicture Picture1.image, "c:\1.bmp"
    SavePicture Picture2.image, "c:\2.bmp"
    SavePicture Picture3.image, "c:\3.bmp"
    SavePicture Picture4.image, "c:\4.bmp"即可