如何最好地对“现场着色器”进行编程程序 - 非常简单!
抱歉,这个奇怪的标题,我想不出更好的了!
无论如何,我正在编写一个程序(Windows Forms App),该程序读取固定宽度的文件,从用户输入中收集字段长度,然后应该显示第一行的每一列文件的颜色不同...你知道我的意思吗?它基本上是使用颜色来区分固定宽度文件中的不同字段。
我想问的是解决这个问题的最佳方法是什么?因为我遇到了很多麻烦,当我知道有更好的解决方案时,我不断遇到问题并实施令人厌恶的解决方案。
显然你不必给我一个完整的程序,只需给我一些更好的方法来解决这个问题的想法 - 因为我的解决方案太可怕了。
提前谢谢大家!
Sorry for the weird title, I could't think of anything better!
Anyways, I'm half way through writing a program (Windows Forms App) that reads in a fixed-width file, gathers field lengths from user input, then it's supposed to display each column from the first line of the file in a different color... Do you know what I mean? It's basically to differentiate between the different fields in a fixed-width file using color.
What I wanted to ask was what was the best way to go about this? Because I'm having a lot of trouble, and I keep running into things and just implementing disgusting solutions when I know there is a much better one.
Obviously you don't have to give me a whole program, just some ideas of better ways to go about this - because my solution is just horrendous.
Thank you all in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会使用 RichTextBox。这是更改文本颜色的简单方法。下面是一个示例,其中我有 3 个来自用户的输入,用于说明每列的宽度。然后它读入文件并适当地为宽度着色。希望这会给您带来更多想法。
I would use a RichTextBox. This has an easy way to change the color of text. Here is an example where I have 3 inputs from the user that tells how wide each column should be. Then it reads in a file and colors the widths appropriately. Hopefully this will give you some more ideas.