Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 6th, 2007, 01:23 PM
Authorized User
 
Join Date: Oct 2006
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Default combobox

Is there anything similar to a combobox that you can use on a webform? I need a control where the user can select and type in information.

 
Old December 6th, 2007, 01:35 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Not that ships with VS, no. You will need to create your own control to do this. Google to the rescue:

http://www.google.com/search?hl=en&r...n+List&spell=1

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old December 6th, 2007, 03:19 PM
Authorized User
 
Join Date: Oct 2006
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Default

do you think it's possible to bind the data to a multiline textbox. Sort of like this? or does it only work with drop down lists?

Private Sub BindState(ByVal ddl As DropDownList)
        connAAP = New SqlConnection(Application("connAAP"))
        Dim cmdSelect As SqlCommand = New SqlCommand("Select distinct vchCompanyname from tblAAPInfo", connAAP)
        Dim dtrState As SqlDataReader

        Try
            connAAP.Open()
            dtrState = cmdSelect.ExecuteReader()

            'While dtrState.Read
            Dim newListItem As New ListItem
            ddlConame.DataSource = dtrState
            ddlConame.DataTextField = "vchcompanyname"
            ddlConame.DataBind()
            ' End While

            dtrState.Close()
            connAAP.Close()

        Catch er As Exception
            LogError(er.ToString, "BindState")
            Exit Try
        Finally
            connAAP.Close()
        End Try
    End Sub

 
Old December 6th, 2007, 03:29 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

As you propose, no.

This will place text into a multiline textbox with each element on its own line:

TextBox1.Text = "This is a test.\r\nfoo";

And the text in the box will look like this:
This is a test
foo

But this isn't functional for anything it would simply display data and you would have no notion of a DataText or DataValue field.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
combobox nagarajuballa Java GUI 0 August 13th, 2008 03:49 AM
Filling Combobox with value from other Combobox ayazhoda Access VBA 6 June 5th, 2007 04:58 AM
Combobox stepdev Excel VBA 1 May 22nd, 2006 02:50 PM
New to ComboBox adriant42 Excel VBA 3 August 23rd, 2004 12:32 PM
ComboBox: HELP! ;) ashley_y ADO.NET 1 December 29th, 2003 10:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.