本文介绍了是否可以在C#中将颜色设置为特定的输入值/字? (视觉工作室)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好。

我想知道是否可以编写我可以编写的内容(例如)输入一个单词,比如让我们说'blue'到我的程序中并得到一个指定的/设置颜色显示在图片框中?



所以我可以为'蓝色'创建一个方法或类,它将在其中编码以设置蓝色显示在图片框/显示框中?



提前感谢您的任何建议。



我尝试了什么:



我没有尝试太多我只是想知道是否可以编写这样的东西。

Hi there.
I am wanting to know if it is possible to code something where I can (for example) input a word such as lets say 'blue' into my program and get a specified/set colour to display in a picture box?

So can i maybe create a method or class for 'blue' that will have coding in it to set the colour blue to display in a picture box/display box?

Thank you in advance for any advice.

What I have tried:

I haven't tried much I just want to know if it is possible to code such a thing.

推荐答案

引用:

我没有尝试太多我只是想知道是否可以编写这样的东西。

I haven't tried much I just want to know if it is possible to code such a thing.



简答:是的。

你需要一个带有颜色名称和颜色代码的清单。

当用户输入颜色名称时,您需要匹配列表并在图片bo中应用颜色代码x / display box / canva。


Short answer: Yes.
You need a list with color names and color codes.
When user input color name, you need to match in list and apply color code in picture box/display box/canva.


这篇关于是否可以在C#中将颜色设置为特定的输入值/字? (视觉工作室)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 14:10
查看更多