Refresh Form (VB)

Discussion in 'SolidWorks' started by DunNow, Dec 2, 2005.

  1. DunNow

    DunNow Guest

    Hello,


    I've programmed a Macro in VB. A form pop-ups with 2 tabs on it. On the

    first tab stands a combobox and on the second tab a few textboxes. When

    i choose something in the combobox a few textboxes will be visible,
    that works great, but :


    If i choose another thing in the combobox and other textboxes will be
    visible he doesn't refresh the form. I know there's a method in access
    called Requery.


    Now i need something like that for the form. Can someone help me with
    this?


    Kind Regards,


    Patrick
     
    DunNow, Dec 2, 2005
    #1
  2. DunNow

    That70sTick Guest

    What about Form.Repaint?
     
    That70sTick, Dec 2, 2005
    #2
  3. DunNow

    DunNow Guest

    That doens't work..

    i tried it..but thx for the replie
     
    DunNow, Dec 2, 2005
    #3
  4. DunNow

    DunNow Guest

    That doens't work.. I tried that

    but thx for the replie :)
     
    DunNow, Dec 2, 2005
    #4
  5. DunNow

    Tony Guest

    How about Form.Refresh and then a Form.Repaint. And if that doesn't work
    try a DoEvents

    Tony
     
    Tony, Dec 6, 2005
    #5
  6. DunNow

    DunNow Guest

    hmmz ..form.refresh is not an object.

    but I use a if... elseif.. else ... end if

    If cmbDescriptionBP.Value = "Piston" Or cmbDescriptionBP.Value =
    "Piston Part" Then
    Frame5.Repaint
    Frame7.Repaint
    LbBoreDiamBP.Visible = True
    txtBoreBP.Visible = True
    txtBoreEenheidBP.Visible = True
    txtBuildInBP.Visible = True
    LbBuildInBP.Visible = True
    txtBuildInEenhBP.Visible = True
    Frame7.Height = 36
    LbMountEP.Visible = True
    cmbMountingBP.Visible = True
    FramMount.Height = 35
    FramGuid.Visible = True
    FramGuid.Top = 50
    LbGuidEP.Visible = True
    cmbGuideStripEP.Visible = True
    FramMat.Visible = True
    FramMat.Top = 95
    LbMatEP.Visible = True
    cmbMatEP.Visible = True
    FramCert.Visible = True
    FramCert.Top = 141
    LbCertEP.Visible = True
    cmbCertEP.Visible = True
    FramStd.Visible = True
    FramStd.Top = 187
    LbStdEP.Visible = True
    cmbStdEP.Visible = True
    LbRodDiamBP.Visible = False
    txtRodBP.Visible = False
    txtRodEenheidBP.Visible = False
    LbInDiamBP.Visible = False
    txtInDiamBP.Visible = False
    txtInDiamEenhBP.Visible = False
    LbExDiamBP.Visible = False
    txtExDiamBP.Visible = False
    txtExDiamEenhBP.Visible = False
    LbLenThickBP.Visible = False
    txtLenThickBP.Visible = False
    txtLenThickEenhBP.Visible = False
    LbHoleDiamBP.Visible = False
    txtHoleDiamBP.Visible = False
    txtHoleDiamEenhBP.Visible = False
    LbWidthBP.Visible = False
    txtWidthBP.Visible = False
    txtWidthEenhBP.Visible = False
    LbConMesBP.Visible = False
    txtConMesBP.Visible = False
    txtConMesEenhBP.Visible = False
    LbHeightBP.Visible = False
    txtHeightBP.Visible = False
    txtHeightEenhBP.Visible = False
    LbWidthBetPlsBP.Visible = False
    txtWidthBetPlsBP.Visible = False
    txtWidthBetPlsEenhBP.Visible = False


    ElseIf cmbDescriptionBP.Value = "Piston Nut" Then
    FramMount.Visible = False
    LbBoreDiamBP.Visible = True
    txtBoreBP.Visible = True
    txtBoreEenheidBP.Visible = True
    txtBuildInBP.Visible = True
    LbBuildInBP.Visible = True
    txtBuildInEenhBP.Visible = True
    Frame7.Height = 36
    FramGuid.Visible = True
    FramGuid.Top = 6
    LbGuidEP.Visible = True
    cmbGuideStripEP.Visible = True
    FramMat.Visible = True
    FramMat.Top = 51
    LbMatEP.Visible = True
    cmbMatEP.Visible = True
    FramCert.Visible = True
    FramCert.Top = 97
    LbCertEP.Visible = True
    cmbCertEP.Visible = True
    FramStd.Visible = True
    FramStd.Top = 143
    LbStdEP.Visible = True
    cmbStdEP.Visible = True

    ElseIf cmbDescriptionBP.Value = "Gland" Then
    Frame5.Repaint
    Frame7.Repaint
    LbBoreDiamBP.Visible = True
    txtBoreBP.Visible = True
    txtBoreEenheidBP.Visible = True
    txtBuildInBP.Visible = True
    LbBuildInBP.Visible = True
    txtBuildInEenhBP.Visible = True
    Frame7.Height = 60
    txtExDiamBP.Top = 30
    txtExDiamEenhBP.Top = 30
    LbExDiamBP.Top = 30
    txtExDiamBP.Visible = True
    txtExDiamEenhBP.Visible = True
    LbExDiamBP.Visible = True
    LbMountEP.Visible = True
    cmbMountingBP.Visible = True
    FramMount.Height = 35
    LbCushEP.Visible = True
    cmbCushEP.Visible = True
    FramCush.Visible = True
    FramCush.Top = 50
    LbConEP.Visible = True
    cmbConEP.Visible = True
    FramCon.Visible = True
    FramCon.Top = 95
    LbMatEP.Visible = True
    cmbMatEP.Visible = True
    end if
     
    DunNow, Dec 6, 2005
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.