none
如何实现 类似3dsmax的材质编辑器 或者 VS里的着色器设计 RRS feed

  • 问题

  • 最好是c# wpf的 c++的可以 毕竟能搞在一起。

    以Grid为载体 大体样式可以做出来 但是没有链接线 我想做出类似于 3dsmax 材质编辑器的样子 。

    求大神 指点  最好能带上完整代码  我是新手。

    2015年6月14日 14:47

答案

  • 试试这段:

    FrameworkElement parent = (FrameworkElement)textBox.Parent;
    while (parent != null && parent is IInputElement && !((IInputElement)parent).Focusable)
    {
        parent = (FrameworkElement)parent.Parent;
    }
    
    DependencyObject scope = FocusManager.GetFocusScope(textBox);
    FocusManager.SetFocusedElement(scope, parent as IInputElement);

    或者直接用clear这个方法:

    https://msdn.microsoft.com/en-us/library/system.windows.input.keyboard.clearfocus.aspx



    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2015年6月17日 1:30

全部回复

  • 你好,

    C++,C#和WPF你想怎么整合呢?看起来很乱的样子。类似的编辑器的话,有点复杂,我估计只能给你一些opensource的现成的例子,你可以参考参考:

    https://github.com/helix-toolkit/helix-toolkit

    http://www.odewit.net/ArticleList.aspx?key=Perspective3D&lang=en



    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2015年6月15日 10:03
  • 这不是我想要的  不过我已经解决了         wpf 中textbox 按下回车结束输入如何实现你知道吗

    keyDown事件是这样处理的  但是光标依然在textbox里面  并没有结束输入  求解

                if (e.Key==Key.Enter)
                {
                    this.Focus();
                }

    2015年6月15日 10:57
  • 试试这段:

    FrameworkElement parent = (FrameworkElement)textBox.Parent;
    while (parent != null && parent is IInputElement && !((IInputElement)parent).Focusable)
    {
        parent = (FrameworkElement)parent.Parent;
    }
    
    DependencyObject scope = FocusManager.GetFocusScope(textBox);
    FocusManager.SetFocusedElement(scope, parent as IInputElement);

    或者直接用clear这个方法:

    https://msdn.microsoft.com/en-us/library/system.windows.input.keyboard.clearfocus.aspx



    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2015年6月17日 1:30
  • 将焦点 设置到父对象就可以了吗
    2015年6月17日 13:07
  • 对的,你可以试一下来看看结果,不行的话我接着帮你看看


    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2015年6月23日 5:22