Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 ListBox 控件中显示自定义格式的文本?ListBox 控件绑定到从两个连接表中读取数据的数据源。我想像这样格式化 ListBox 项目文本:[用户名,密码]。我想在 .aspx 页面中执行此操作。
您不能自定义格式文本的样式。但是,您可以自定义内容。
有很多方法可以做到这一点。其中之一是使用一些可以实现您需要的SQL查询来绑定数据,或者从数据库中获取数据,循环并进行修改,然后将其绑定到列表框。