如何在代码中调用项目资源?

在写Uri时:

new Uri("/Silverlight;component/images/hand.png", UriKind.RelativeOrAbsolute)
其中,/Silverlight是项目名称,component/后面是相对项目根目录的资源路径。

如何屏蔽Silverlight自己的右键菜单?

在相应元素的MouseRightButtonDown中将e.Handled设为true即可:

private void LayoutRoot_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
    e.Handled = true;//屏蔽默认的右键菜单
}

如需自定义右键菜单则在这里添加相应事件。


文本框不能自动随着内容添加自动往下滚动?

在其TextChanged事件中,调用一下它的Select方法选择一下最后的字符。。。

private void tb_msg_TextChanged(object sender, TextChangedEventArgs e)
{
    tb_msg.Select(tb_msg.Text.Length - 1, 0);
}

就是这样。。。

相关文章:

  • 2021-04-21
  • 2021-07-14
  • 2022-01-14
  • 2022-01-12
  • 2021-11-09
  • 2021-04-11
  • 2021-11-26
  • 2021-04-09
猜你喜欢
  • 2021-10-30
  • 2021-12-09
  • 2021-12-19
  • 2021-12-19
  • 2021-06-25
  • 2021-04-17
相关资源
相似解决方案