奇怪的C#标签故障 [英] Weird C# label glitch

查看:67
本文介绍了奇怪的C#标签故障的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,这很奇怪。我正在用C#测试搜索功能,我使用以下输入来测试它:



什么是\\\\\\?



当解决方案在表单上的标签中显示时,它只显示为是什么。结束了,所以我尝试在\\之前加上一个a。再次,它只显示是什么。然后,我把它改为:



什么是hi\\?sdfklsj



整个事情出现了。然后,我改为:



什么是hi\\?



整个事情都出现了。这真的很奇怪。几乎就像在标签的最后一个单词中的文字会导致标签的末尾被省略。还有其他人经历过这个吗?有谁知道如何修复它?



提前谢谢你,Ben

Ok, this is weird. I was testing a search function in C# and i used the following input to test it:

what is "\\hi\\"?

When the solution showed this in a label on the form, it only showed up as "what is". The end was missing, so I tried putting an "a" before the "\\. Again, it only showed "what is". Then, I changed it to:

what is "hi\\"? sdfklsj

And the whole thing showed up. Then, I changed it to:

what is "hi\\"?

And the whole thing showed up. This is really weird. It''s almost as if "\ in the last word of a label''s text causes the end of the label to be omitted. Has anyone else experienced this? Does anyone know how to fix it?

Thankyou in advance, Ben

推荐答案

我刚试过我能想到的每一种方式都可以复制这个:没有任何作用。我无法通过 myLabel.Text = ... 的任何组合来解释这种行为。



我认为你需要看看你的标签 - 还有其他影响吗?如果添加第二个标签会发生什么,并设置它的Text属性?相同,还是不同?



尝试重新启动VS并清理解决方案,万一有些东西已经损坏。不太可能,但可能。



FYI:VS2010,C#,. NET 4.0



如果不是这样的话显示任何内容,显示您的代码,我会尝试用它复制它。
I have just tried every way I can think of to duplicate this: nothing works. I cannot casue this behaviour by any combination of myLabel.Text = ... that I can think of.

I think you need to look at your label - is there anything else affecting it? What happens if you add a second label, and set the Text property of that as well? The same, or different?

And try restarting VS and Cleaning your solution, in case something has become corrupt. Unlikely, but possible.

FYI: VS2010, C#, .NET 4.0

If none of that shows anything, show your code and I''ll try to duplicate it with that.


这篇关于奇怪的C#标签故障的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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