.NET Framework - Disabling expanding a HierarchyNode while double clicking...
Asked By Nag
19-Aug-09 03:32 PM
Hi,
I am maintaining an vs explorer (similar to solution explorer or server
explorer). My nodes are expandable items.
I want to expand them if and only if user tries to expand it with the
gesture (expandable sign, for ex: "+").
i dont want it to be expanded when user double clicks on the node.
In a way similar behaviour to "xamls" files. In WPF app when we double click
on "xaml" files we show designer and it expands if and only if users clicks
on the gesture.
It will be great if anyone points me how to do this...
thanks,
nag
VSConstants.VsUIHierarchyWindowCmdIds.UIHWCMDID
(1)
VsMenus.guidVsUIHierarchyWindowCmds
(1)
WPF
(1)
ExecCommandOnNode
(1)
HierarchyNode
(1)
ProjectNode
(1)
EnterKey
(1)
CmdGroup
(1)
ReedShilts replied to Nag
I had to do the same thing in my project system.
If you are derived from the MPF "ProjectNode" this will work...
In your overload of "ExecCommandOnNode(...)"
catch and return S_FALSE rather than S_OK to the double-click and the
enter-key actions. Like:
if (cmdGroup == VsMenus.guidVsUIHierarchyWindowCmds)
{
switch (cmd)
{
case
(uint)VSConstants.VsUIHierarchyWindowCmdIds.UIHWCMDID_DoubleClick:
case (uint)VSConstants.VsUIHierarchyWindowCmdIds.UIHWCMDID_EnterKey:
this.DoDefaultAction();
return VSConstants.S_FALSE; // this prevents the
sub-nodes from opening
//return VSConstants.S_OK;
}
}
Hope this helps,
Reed Shilts
Nag replied to ReedShilts
Thanks a lot Reed...
it solved my problem.
regards,
nag
Can a WPF window host another WPF window? .NET Framework I am not looking for a "hybrid" WPF / WinForm or WinForm / WPF solution, but rather a pure WPF / WPFsolution. I want to host a WPF window inside another WPF window. I want to host a WPF window as a "control" inside another WPF window, much like a button is hosted inside
ANN: WPF DataGrid CTP .NET Framework Microsoft hat das oft vermisste WPF DataGrid Control als Open-Source CTP veröffentlicht: Blog WPF Toolkit - Preview Video DataGrid Preview & Control Investments in WPF 3.5 SP1 Codeplex WPF WPF Futures Roadmap - - Thomas Scheidegger - 'NETMaster' http: / / dnetmaster.net / C# - German Discussions Silverlight (1) DataGrid (1 XAML (1) WPF (1) Control (1) Suite (1) Grid (1) DataGridView (1) . . .klasse! Wir waren kurz vor der wenn man das mal mit dem DataGridView vergleicht. Vor allen Dingen wird - begründet in der WPF-UI- Infrastruktur - ein "custom templating" der Zellen möglich sein und auch ein Detail-View
windowsforms or WPF? .NET Framework WPF is released, Orcas (VS 2008) is coming. Although Windows Forms will be supported for long time, is it a better choice to turn to WPF now? .NET Windows Forms Discussions WPF (1) Outlook (1) Application (1) Hi Allen, Windows Forms will coexist with WPF as there are things WPF can't do (like MDI) or not particularly suited to do. Maybe in the long we will learn to do without MDI, or decent MDI managers will be created for WPF. Considering WPF is still pretty new to the public I'd say Windows Forms is still valid