CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2009
    Posts
    192

    Textbox populate

    Hi,

    I have a textbox called txtProjname , I also have a combobox called cmbactiveproj. cmbactiveproj is populated from a dataset called activeprojects. This shows a dropdown list of all the projects.

    The dataset which loads the combobox is read from the dataset shown below;

    Code:
    Me.ActiveprojectsTableAdapter.FillBy(Me.Dsactiveprojects.activeprojects)
    Now, I want to populate txtProjname with the project when a project is clicked at the cmbactiveproj. So I have the folowing code;


    Code:
    Private Sub cmbactiveproj_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbactiveproj.Click
    
            txtProjname.Clear()
            txtProjname.Text = cmbactiveproj.Text
    
    
        End Sub
    The above code reads the previous clicked project and populates it to txtProjname not the current project. Any help please..
    Thanks

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Textbox populate

    Have you tried using the selecteditem property instead?
    Always use [code][/code] tags when posting code.

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