如何在c#.net中动态更改列表框的大小 [英] how to change size of list box dynamically in c#.net

查看:69
本文介绍了如何在c#.net中动态更改列表框的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
在一个项目中,我想创建一个列表框,以根据插入到列表框中的数据来更改其大小.如果有人知道,请帮助我.using(asp.net,c#)

Hi All,
In a project i want to make a list box to change its size according to the data inserted in the list box. if any body know help me.using(asp.net,c#)

推荐答案

如果未指定Width,则Select标记会根据Options的长度自动设置其大小.样式属性中选择标签的说明,

The Select tag automatically sets its size depends on Options length, if you donot Specify the Width of the Selection tag in Style Property,

<select id="Select" ></select>


并从javascript(Jquery)中插入选项


and insert options from javascript(Jquery)


(" span>).append(" + city + '>" + city + );
("#Select").append("<option value='"+city+"'>"+city+"</option>");


嗨shshikanth,

http://bytes.com/topic/c-sharp/answers/611387-listbox-size-not-growing-fill-increased-size-flowlayoutpanel [ http://forums.asp.net/t/757579.aspx/1 [ ^ ]
Hi shshikanth,

http://bytes.com/topic/c-sharp/answers/611387-listbox-size-not-growing-fill-increased-size-flowlayoutpanel[^]

http://forums.asp.net/t/757579.aspx/1[^]


这篇关于如何在c#.net中动态更改列表框的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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