CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2001
    Posts
    10

    combobox, label, command

    please help me..
    i have put material codes in a combobox and added a lable to show the specifications of that chosen material. and i have put a command button. when i chose the material from the combobox i press the command button and show the specification in lable but i am having problem. when i chose the material and pressing the command button the first specification shows up in the label but when i change the material in the combobox and press the enter the new materials specification does not show up but first materials stay there forever..i had written a code for that transfer like that.
    If Combo1.DataField = C10 Then
    Label3.Caption = 295
    End If
    If Combo1.DataField = 2 - C15 Then
    Label3.Caption = 355
    End If
    If Combo1.DataField = Ck10 Then
    Label3.Caption = 295
    End If
    If Combo1.DataField = Ck15 Then
    Label3.Caption = 355
    End If
    If Combo1.DataField = 15 - Cr3 Then
    Label3.Caption = 355
    End If
    end sub
    if you know what i should to fix it.. please help me...
    respects..



    Serdar Yorulmaz

  2. #2
    Join Date
    Jun 2001
    Location
    Sri Lanka
    Posts
    272

    Re: combobox, label, command

    1. Use Combo1.Text instead of DataField
    This will resolve ur problem.
    2 .Better to have ElseIf rather than having individual If.... checks
    Srinika

    If u don't know how to Rate an answer, then Rate my answer to learn, If u know, then practice it

  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: combobox, label, command

    After assigning label caption try
    Label1.Refresh

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured