Listview,列表内有两个组合框 [英] Listview with two combobox inside list

查看:109
本文介绍了Listview,列表内有两个组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我想在listview内创建一个带有2个组合框的listview

如果有人给我发送一些代码行,我真的很感激.. vb.net中的菜鸟

感谢和问候.

Hi to all

I want to create a listview with 2 combobox inside listview

I really appreciate if someone send me some line with codes....... rookie in vb.net

Thanks and regards.

推荐答案

我希望以下代码有帮助:-

I hope the following code helps: -

frm_load()
comboControl = New ComboBox()
        comboControl.Cursor = System.Windows.Forms.Cursors.Arrow
        comboControl.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown
        comboControl.Dock = DockStyle.Fill
        comboControl.Items.Add("Information Technology")
LvResults.Controls.Add(comboControl) ' then u can add your combobox into your listview
       comboControl.BringToFront()
end sub()




希望这对您有所帮助.如果有人有更好的解决方案,我也想知道.

-
AJ




Hope this helps you. If some one has a better solution I would also like to know.

--
AJ


此讨论 [
This discussion [^]should help you get started.


感谢您的发帖.......

我认为如果要制作一个数据网格是更好的解决方案.

我只用一个数据网格制作了一个新产品,并添加了2列和1个组合框.

在表单加载中,我编写此代码

Thanks for your post.......

I thinkig if to make a datagrid it is better solution.

I make a new prodgect with only one data grid and i have add 2 columns and 1 combobox.

In form load i write this code

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim Con As OleDbConnection
    Dim adapter As New OleDbDataAdapter
    Dim dataSet As New DataSet
    Dim sqlCmd As OleDbCommand = New OleDbCommand("Select * from line order by line_id")
    Con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source = C:\Documents and Settings\Roidoulis\Επιφάνεια εργασίας\Roller_Database\bin\Debug\Roller_old.mdb")
    Try
        Con.Open()
        sqlCmd.Connection = Con
        adapter.SelectCommand = sqlCmd
        adapter.Fill(dataSet)
        With DataGridView1
            .DataSource = dataSet.Tables(0)

        End With
    Catch 'ex As OledbException
    End Try
    adapter.Dispose()
    Con.Close()
    Con.Dispose()
End Sub



数据网格填充确定,但我的第一三列保持为空.
我如何在表格前填入自己的列?



The datagrid fill ok BUT me three first column stay empty.
How can i fill me own columns fron the table??


这篇关于Listview,列表内有两个组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆