⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 钢结构设计数据库应用
💻 FRM
📖 第 1 页 / 共 3 页
字号:
            ColumnWidth     =   599.811
         EndProperty
         BeginProperty Column15 
            ColumnWidth     =   599.811
         EndProperty
         BeginProperty Column16 
            ColumnWidth     =   599.811
         EndProperty
         BeginProperty Column17 
            ColumnWidth     =   599.811
         EndProperty
      EndProperty
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   324
      Left            =   5400
      Top             =   9840
      Width           =   3468
      _ExtentX        =   6117
      _ExtentY        =   572
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   2
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=结构设计.mdb;Persist Security Info=False"
      OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=结构设计.mdb;Persist Security Info=False"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "表1槽钢"
      Caption         =   "槽钢"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   13.8
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Label Label3 
      Caption         =   "弹性模量"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   9720
      TabIndex        =   34
      Top             =   5160
      Width           =   1332
   End
   Begin VB.Label Label5 
      Caption         =   "荷载 P"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   15.6
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   492
      Left            =   5640
      TabIndex        =   31
      Top             =   1680
      Width           =   1092
   End
   Begin VB.Label Label4 
      Caption         =   "惯性矩 I "
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   6960
      TabIndex        =   30
      Top             =   4680
      Width           =   1452
   End
   Begin VB.Label Label2 
      Caption         =   "荷载位置 x"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   15.6
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Index           =   0
      Left            =   5760
      TabIndex        =   29
      Top             =   0
      Width           =   1812
   End
   Begin VB.Label Label2 
      Caption         =   "梁长 L"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   15.6
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Index           =   1
      Left            =   5640
      TabIndex        =   28
      Top             =   1080
      Width           =   1092
   End
   Begin VB.Image Image1 
      Height          =   336
      Left            =   2400
      Picture         =   "Form1.frx":002A
      Top             =   1680
      Width           =   120
   End
   Begin VB.Label Label1 
      Caption         =   "荷載位置"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   15.6
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Index           =   6
      Left            =   6240
      TabIndex        =   9
      Top             =   3600
      Visible         =   0   'False
      Width           =   1332
   End
   Begin VB.Menu mnuNew 
      Caption         =   "New"
   End
   Begin VB.Menu mnuFileIn 
      Caption         =   "FileIn"
   End
   Begin VB.Menu mnuFileOut 
      Caption         =   "FileOut"
   End
   Begin VB.Menu mnuEnd 
      Caption         =   "End"
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim a#(100), EE#, II#

Private Sub CommandGetData_Click()
    Dim h#, b#, d#, t#, r#, r1#, sc#
    For i = 0 To 6
        Text1(i) = Adodc1.Recordset.Fields(i + 1)
    Next
    h = Text1(1).Text
    b = Text1(2).Text
    d = Text1(3).Text
    t = Text1(4).Text
    r = Text1(5).Text
    r1 = Text1(6).Text
    TextII = Adodc1.Recordset.Fields(11)
    TextEE.Text = Adodc2.Recordset.Fields(3)
    比例 h, sc
    Draw槽钢断面 h, b, d, t, r, r1, sc
End Sub

Public Sub 比例(h#, sc#)
    If h < 100 Then
        sc = 40
    ElseIf h < 200 Then
        sc = 20
    ElseIf h < 400 Then
        sc = 10
    End If
End Sub

Public Sub Draw槽钢断面(h#, b#, d#, t#, r#, r1#, sc#)
    Dim x1#, x2#, y1#, y2#, x#, sc2#
    sc2 = sc / 2
    Picture1.Width = (b + 2) * sc
    Picture1.Height = (h + 2) * sc
    Picture1.Scale (-sc, h * sc2 + sc)-(b * sc + sc, -h * sc2 - sc)
    Picture1.Cls
    y0 = h * sc2
    x1 = d * sc
    x2 = b * sc
    x = x2 - (b - d) * sc2
    y = y0 - t * sc
    y2 = y + (x2 - x) * 0.1
    y1 = y + (x1 - x) * 0.1
    
    Picture1.Line (0, -y0)-(0, y0)
    Picture1.Line -(x2, y0)
    Picture1.Line -(x2, y2)
    Picture1.Line -(x1, y1)
    Picture1.Line -(x1, -y1)
    Picture1.Line -(x2, -y2)
    Picture1.Line -(x2, -y0)
    Picture1.Line -(0, -y0)
End Sub

Private Sub CommandAdd_Click()
    Adodc1.Recordset.MoveLast
    a(0) = Adodc1.Recordset.Fields(0)
    For i = 1 To 17
        a(i) = Adodc1.Recordset.Fields(i)
    Next
    Adodc1.Recordset.MoveNext
    Adodc1.Recordset.AddNew
        Adodc1.Recordset.Fields(0) = a(0) + 1
    For i = 1 To 17
        Adodc1.Recordset.Fields(i) = a(i)
    Next
End Sub

Private Sub CommandMoveLast_Click()
    Adodc1.Recordset.MoveLast
End Sub

Private Sub CommandMoveFirst_Click()
    Adodc1.Recordset.MoveFirst
End Sub

Private Sub CommandMoveNext_Click()
    If Not Adodc1.Recordset.EOF Then
        Adodc1.Recordset.MoveNext
    End If
End Sub

Private Sub CommandMovePrev_Click()
    If Not Adodc1.Recordset.BOF Then
        Adodc1.Recordset.MovePrevious
    End If
End Sub

Private Sub Command2_Click()
    Dim x0#, y0#, x#, y#, xP#, x1#, y1#
    x0 = 500
    y0 = 1000
    Cls
    p = Val(TextP.Text)                         '输入
    II = Val(TextII.Text)
    EE = Val(TextEE.Text) * 10000#
    xP = Val(TextxP.Text)
    L = Val(TextL.Text)
    c = 100000000# / EE / II
    If p * c * L = 0 Then MsgBox ("请输入各项数据!") '当荷载位置,荷载大小,I其中任何一个无数据时,显示MSGBOX提示
    Line (x0, y0)-(x0 + L * 50, y0)                 '画梁简图
    Line (x0, y0 - 500)-(x0, y0 + 500)
    For y = y0 - 200 To y0 + 400 Step 200
        Line (x0 - 200, y)-(x0, y - 200)
    Next
    Image1.Left = x0 + xP * 50 - 50
    Image1.Top = y0 - 400
    
    y1 = 0                                              '绘位移图
    x1 = 0
    For x = 0 To xP Step 1
        y2 = p * x * x * (3 * xP - x) / 6 / EE / II * 10000
        x2 = x * 50
        Line (x0 + x1, y0 + y1)-(x0 + x2, y0 + y2), vbRed
        x1 = x2
        y1 = y2
    Next
    y = p * xP * xP * (3 * L - xP) / 6 / EE / II * 10000
    Line -(x0 + L * 50, y0 + y), vbRed
    
    fa = p
    y0 = y0 + 3000
    Line (x0, y0)-(x0 + L * 50, y0)
    y1 = -p * xP * 0.2
    Line (x0, y0 + y1)-(x0 + xP * 50, y0), vbRed        '绘弯矩图
    x1 = 0
    For x = 0 To L Step 2
        If x < xP Then
            y2 = (-fa * xP + p * x) * 0.2
        Else
            y2 = 0
        End If
        x2 = x * 50
        Line (x0 + x1, y0 + y1)-(x0 + x2, y0 + y2), vbRed
        Line (x0 + x2, y0)-(x0 + x2, y0 + y2), vbRed
        x1 = x2
        y1 = y2
    Next
End Sub


Private Sub DataGrid1_Click()
    CommandGetData_Click
End Sub

Private Sub DataGrid2_Click()
    CommandGetData_Click
End Sub

Private Sub Form_Load()
    Form1.Top = 0
    Form1.Left = 0
    x0 = 500
    y0 = 1000
    Cls
    TextxP = HScroll1.Value
    xP = Val(TextxP.Text)
    L = Val(TextL.Text)
    Line (x0, y0)-(x0 + L * 50, y0)                 '画梁简图
    Line (x0, y0 - 500)-(x0, y0 + 500)
    For y = y0 - 200 To y0 + 400 Step 200
        Line (x0 - 200, y)-(x0, y - 200)
    Next
    Image1.Left = x0 + xP * 50 - 50
    Image1.Top = y0 - 400
End Sub

Private Sub mnuEnd_Click()
    End
End Sub

Private Sub mnuFileIn_Click()
    Dim fName$
    CommonDialog1.FileName = "*.txt"
    CommonDialog1.ShowOpen
    fName = CommonDialog1.FileName
    Open fName For Input As #1
    Input #1, n
    For i = 1 To n
    Next
End Sub

Private Sub mnuFileOut_Click()
    Dim fName$
    CommonDialog1.FileName = "*.txt"
    CommonDialog1.ShowOpen
    fName = CommonDialog1.FileName
    Open fName For Output As #9
    Do While Not Adodc1.Recordset.EOF
        For i = 0 To 17
            Print #9, Adodc1.Recordset.Fields(i);
        Next
        Print #9,
        Adodc1.Recordset.MoveNext
    Loop
End Sub

Private Sub HScroll1_Change()
    TextxP = HScroll1.Value
    Command2_Click
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -