本文介绍了Wpf如何设置工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在尝试将工具提示设置为文本框,但我一直收到错误:



类型' System.NullReferenceException '发生在e-Learning.exe中但未在用户代码中处理

错误:对象引用不是设置为对象的实例



代码:

HiI am trying to set a tooltip to a textbox progamatically,but i am keep getting the error:

An exception of type 'System.NullReferenceException' occurred in e-Learning.exe but was not handled in user code
The error :Object reference not set to an instance of an object.

the code:

ToolTip tt = new ToolTip();
            tt.Content="Introduceti adresa URL a videocipului";
             loca.ToolTip = tt;





任何想法如何设置工具提示?

如果我不够清楚,我很抱歉。

PSloca是文本框的名称



any ideas how can i set the tooltip ?
I am sorry if i wasn't clearly enough.
P.S "loca" is the name of the textbox

推荐答案



这篇关于Wpf如何设置工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-18 00:03
查看更多