Visual Basic 2015 backcolor [英] Visual basic 2015 backcolor

查看:86
本文介绍了Visual Basic 2015 backcolor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将颜色菜单项的背面颜色更改为用户从对话框中选择的颜色的代码是什么。如何获得对话框?



我尝试过:



colortoolstripmenuitem.backcolor = color。 (用户从颜色对话框中选择的颜色)

What would be the code to change the Back color on a Color Menu Item to a color that the user selects from a dialog box. How to i get dialog box?

What I have tried:

colortoolstripmenuitem.backcolor= color. (whatever color the user selects from color dialog box)

推荐答案

查看我的文章

用于Windows窗体的VB运行时控件设计器 [ ^ ]

在那里,您将找到解决此任务所需的所有示例代码。
Have a look at my article
VB.NET runtime control designer for windows forms[^]
There you will find example code for all you need to solve this task.


您的问题不尽如人意。我将其解释为我如何才能获得在对话框中选择的颜色传递到我要使用该颜色的主窗体



@NotPoliticallyCorrect给你一个很好的链接,如果它只是你感兴趣的颜色... ColorDialog类(System.Windows.Forms) [ ^ ]



如果您想将更多一般信息从对话框传递到表单,请查看此提示 - 在两种表格之间传递信息,第2部分:儿童到父母 [ ^ ] - 它更简单阅读解决方案1中发生的事情的版本。
Your question isn't as clear as it could be. I am interpreting it as "how can I get the color that was selected on the dialog box passed to the main form where I want to use that color"

@NotPoliticallyCorrect has given you a good link if it is only color you are interested in...ColorDialog Class (System.Windows.Forms)[^]

If you want to pass more general information from a Dialog to a form have a look at this Tip - Transferring information between two forms, Part 2: Child to Parent[^] - it's a simpler to read version of what is going on in Solution 1.


这篇关于Visual Basic 2015 backcolor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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