如何在vb.net中的运行时设置列表框bordercolor [英] how to set listbox bordercolor at runtime in vb.net

查看:112
本文介绍了如何在vb.net中的运行时设置列表框bordercolor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在运行时在vb.net中设置列表框bordercolor

how to set listbox bordercolor at runtime in vb.net

推荐答案

如果这是Windows Forms应用程序,那么我认为没有简单的解决方案.但是,如果这是您的Loaded事件中的WPF应用程序,则只需更改listBox BorderBrush属性(例如
If this is a Windows Forms Application then I don''t think there is a simple solution. However if this is a WPF Application in your Loaded event just change the listBox BorderBrush property (e.g.
listBox1.BorderBrush = Brushes.Green

).

或在Page_Load事件中针对Asp.net:

).

or for Asp.net in the Page_Load event:

ListBox1.BorderColor = System.Drawing.Color.Green



注意:如果要在另一个事件中执行此操作,请说一个Button Click事件,它将导致页面刷新.如果您不希望发生这种情况,则必须使用AJAX.



Note: If you want to do this in another event say a Button Click event it will cause the page to refresh. If you do not want this to happen you will have to use AJAX.


这篇关于如何在vb.net中的运行时设置列表框bordercolor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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