Click here to Skip to main content
15,881,757 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Data entry in VB6Flexgrid1 developed by Mostafa Kaisoun Pin
Chris Quinn17-Feb-15 21:37
Chris Quinn17-Feb-15 21:37 
AnswerRe: Data entry in VB6Flexgrid1 developed by Mostafa Kaisoun Pin
den2k8817-Feb-15 22:13
professionalden2k8817-Feb-15 22:13 
GeneralRe: Data entry in VB6Flexgrid1 developed by Mostafa Kaisoun Pin
Preeti197918-Feb-15 22:23
Preeti197918-Feb-15 22:23 
QuestionEntity Framework : Set value of a not-mapped property inside a query Pin
dilkonika17-Feb-15 17:03
dilkonika17-Feb-15 17:03 
QuestionEntity Framework : Incorrect result in child collections when repeat query Pin
dilkonika16-Feb-15 15:53
dilkonika16-Feb-15 15:53 
QuestionWindows Form VB 2010 Pin
BobbyStrain16-Feb-15 6:37
BobbyStrain16-Feb-15 6:37 
SuggestionRe: Windows Form VB 2010 Pin
Richard MacCutchan16-Feb-15 7:42
mveRichard MacCutchan16-Feb-15 7:42 
GeneralRe: Windows Form VB 2010 Pin
BobbyStrain16-Feb-15 8:51
BobbyStrain16-Feb-15 8:51 
Here is the form load and button click code. Only relevant code shown on button click.

Private Sub HoSepForm_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load

        'Plug in default values when the form loads
        txtVaporViscosity.Text = CStr(0.01)
        txtLiquidViscosity.Text = 0.5
        ddlVesselConfig.SelectedIndex = 0
        ddlVesselTypes.SelectedIndex = 0
        spnLiquidSurge.Value = 10
        txtDesignPressure.Text = CStr(250)
        cmdKOType.Text = "Process Separator"
        cmdConfig.Text = "1 Inlet & 1 Outlet"
        cmdMaterial.Text = "CS"
        cmdDiameterIncrease.Visible = False
        cmdDiameterDecrease.Visible = False
        txtVaporFlow.Text = 300000
        txtLiquidFlow.Text = 100000
        txtVaporDensity.Text = 0.5
        txtLiquidDensity.Text = 50
        txtTemperature.Text = 110
        txtOperatingPressure.Text = 200
        txtWaterFlow.Text = 10000
        ckDemister.Checked = False
        lstDropSize.SelectedIndex = 0
        ddlDemister_h.SelectedIndex = 0
        ddlDemister_h.Visible = False
        ddlDemisterDim.Visible = False
        Label23.Visible = False

    End Sub


Sub cmdSize_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdSize.Click
   (dim and some code) 
'Capture all the input parameters & values
        SepType = cmdKOType.Text
        Material = cmdMaterial.Text
        DesignPressure = Val(txtDesignPressure.Text)
        VaporMassFlow = Val(txtVaporFlow.Text)
        LiquidMassFlow = Val(txtLiquidFlow.Text)
        VaporDensity = Val(txtVaporDensity.Text)
        LiquidDensity = Val(txtLiquidDensity.Text)
        VaporVisc = Val(txtVaporViscosity.Text)
        'LiquidVis = Val(txtLiquidViscosity.Text)
        DropSize = Val(lstDropSize.Text)
        HoldTime = Val(lblLiquidSurge.Text)
        OpTemperature = Val(txtTemperature.Text)
        WaterRate = Val(txtWaterFlow.Text)

        'Validate that the input is complete
        If VaporDensity * LiquidDensity * VaporVisc * DropSize > 0 Then
            'Input complete, so calculate drop settling velocity
            DropSpeed = Calculate_Drop_V(DropSize, VaporDensity, LiquidDensity, VaporVisc)
            'Then stick it in the output label on the form
            lblDropSpeed.Text = CStr(System.Math.Round(DropSpeed, 2))
            'Calculate vapor/liquid volumetric flow & holdup volume
            CFSV = VaporMassFlow / VaporDensity / 3600
            CFSL = LiquidMassFlow / LiquidDensity / 3600

            'LVol = CFSL * 60 * HoldTime
            waterdensity = Water_Density(OpTemperature)
            WaterVol = WaterRate / waterdensity / 60
            LVol = ((CFSL * 60) + WaterVol) * HoldTime
            watervisc = Water_Vis(OpTemperature)
            totalliquid = CFSL * 60 + WaterVol
            totalliquiddensity = (LiquidMassFlow + WaterRate) / totalliquid / 60
            lblWaterDensity.Text = CStr(Math.Round(waterdensity, 2))
            lblWaterViscosity.Text = CStr(Math.Round(watervisc, 2))
            'If the input is incomplete, then exit the form, alerting the user.
        Else
     -> this is msgbox that shows before form is visible MsgBox("Input not complete")
            Exit Sub
        End If
(more code)

GeneralRe: Windows Form VB 2010 Pin
Dave Kreskowiak16-Feb-15 9:39
mveDave Kreskowiak16-Feb-15 9:39 
GeneralRe: Windows Form VB 2010 Pin
BobbyStrain16-Feb-15 9:59
BobbyStrain16-Feb-15 9:59 
GeneralRe: Windows Form VB 2010 Pin
Dave Kreskowiak16-Feb-15 10:11
mveDave Kreskowiak16-Feb-15 10:11 
GeneralRe: Windows Form VB 2010 Pin
BobbyStrain16-Feb-15 10:18
BobbyStrain16-Feb-15 10:18 
GeneralRe: Windows Form VB 2010 Pin
Dave Kreskowiak16-Feb-15 10:38
mveDave Kreskowiak16-Feb-15 10:38 
GeneralRe: Windows Form VB 2010 Pin
BobbyStrain16-Feb-15 12:15
BobbyStrain16-Feb-15 12:15 
GeneralRe: Windows Form VB 2010 Pin
Dave Kreskowiak16-Feb-15 12:31
mveDave Kreskowiak16-Feb-15 12:31 
GeneralRe: Windows Form VB 2010 Pin
Richard MacCutchan16-Feb-15 21:18
mveRichard MacCutchan16-Feb-15 21:18 
GeneralRe: Windows Form VB 2010 Pin
BobbyStrain17-Feb-15 5:39
BobbyStrain17-Feb-15 5:39 
GeneralRe: Windows Form VB 2010 Pin
Richard MacCutchan17-Feb-15 6:06
mveRichard MacCutchan17-Feb-15 6:06 
GeneralRe: Windows Form VB 2010 Pin
BobbyStrain17-Feb-15 10:35
BobbyStrain17-Feb-15 10:35 
QuestionEntity Framework : Using summary functions inside a projection Pin
dilkonika15-Feb-15 16:30
dilkonika15-Feb-15 16:30 
AnswerRe: Entity Framework : Using summary functions inside a projection Pin
Dave Kreskowiak15-Feb-15 17:42
mveDave Kreskowiak15-Feb-15 17:42 
GeneralRe: Entity Framework : Using summary functions inside a projection Pin
dilkonika15-Feb-15 17:50
dilkonika15-Feb-15 17:50 
GeneralRe: Entity Framework : Using summary functions inside a projection Pin
Dave Kreskowiak16-Feb-15 2:47
mveDave Kreskowiak16-Feb-15 2:47 
GeneralRe: Entity Framework : Using summary functions inside a projection Pin
dilkonika16-Feb-15 7:54
dilkonika16-Feb-15 7:54 
GeneralRe: Entity Framework : Using summary functions inside a projection Pin
Dave Kreskowiak16-Feb-15 9:41
mveDave Kreskowiak16-Feb-15 9:41 

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.