Animated icon for Winforms Treeview? - winforms

I'd like to show a "Loading" icon as each node of a treeview is waiting to be loaded. I'm picturing the Win 7 waiting circle that spins, but any animated icon would work. Is this possible with the standard Winforms treeview?
I'm on VS 2010, Win 7/64, .NET 3.5. App needs to run on XP/32 as well.

The standard treeview does not support animated cursors or gifs (.cur or .ani; .gif). You can use a timer and swap out the nodes' icon to create your own animation.

Related

Does WPF have GUI layers in the editor?

I have a single window that does initialization first, and then those controls fade out as the Menu controls fade in. Depending on what the user clicks next, the current menu controls will fade out for the next set of controls to fade in.
While developing in the editor (Visual Studio 2017), I often have to hide and show certain controls so I can see the current 'screen layer' I'm interested in.
While I'm working in the editor, is there a way to click on layers in WPF like clicking on tabs? You can think of tabs like "Layer 1" on the window has the initialization controls, then Layer 2 has the menu controls, etc. Then just show/hide layers while developing in the editor like you would in paint programs. I'm just thinking that would make development easier.
No there is no standard way built-in to Visual Studio.
I strongly suggest to split the layers into (user)controls, this way the designer can focus on one thing at the time.

What should I implement for a small popup control in a VSTO project?

In my VSTO projects (Office 2007 / 2010) I would like to use a small popup control (think Tooltip like features; fade animation and mouse interaction).
I would prefer to use WPF. If I were to do this in WPF I would create a custom Popup Control.
In VSTO, as far as I understand it, I must use a WPF window and then have 2 options, either I put this window in a Windows Form Container or I get the Hwnd of my office app and I add this Hwnd to the Owner property of a WPF Window. Am I correct here?
Creating a whole window, animating it on and off the screen etc to look like a ToolTip seems to be overkill.
So my question is how should I do this. I would prefer WPF.
I don't know if this would work but my first thought is to build a very tiny WPF window which is transparent and start it with the Office App. I can then build a Popup Control (which is a child of this tiny window) which I show and not show at a mouse position. Pretty sure a popup can appear outside the bounds of its parent window.
Just wanted to tidy up my own question with what I did. In the VSTO addin project I added a reference to WindowsBase, PresentationFramework and presentation core.
And then I just follow any tutorial or example that adds a WPF Popup. By popup I mean a System.Windows.Controls.Primitives.Popup. For the Placement I used PlacementMode.Absolute and then used a window point to set its position.
This pretty much answers my question. Of course this popup is literally floating above your office window so you will need to make sure that you control it for example if the office window moves, is minimized and the like.

Drag data from VB6 application to WPF application

I am trying to drag a node of a TreeView in a VB6 application to the window of a separate WPF application. The DragEnter event is not firing in the target window. What steps can I take to troubleshoot this issue?
I'm guessing, but IF you're trying to drag over a panel element you need to have a background defined.
From MSDN,
Panel elements do not receive mouse or stylus events if a Background is not defined. If you need to handle mouse or stylus events but do not want a background for your Panel, use Transparent.
You can read the complete post here: https://msdn.microsoft.com/en-us/library/system.windows.controls.panel.background.aspx

Visual studio addin - window children can't get focus

I have some addin for VS2010 which displays window with some many panels. I'm using Avalon docking manager to handle all panels manipulation.
My problem is that all items (listboxs or items control) within the my window can't get focus, even when I'm clicking on them directly. this problem is expressed when i'm trying to use mouse wheel in order to scroll the scrollViews in my window.
Just want to mention that when I'm using my window in a stand alone application (not as VS2010 addin) everything works.
Any idea? Is this Avalon problem?
It's seems to be bug of Avalon.
Updating to latest version fix the problem.

Menu Format is different in Windows 7 vs Windows XP for a Winforms app

I have a Winforms app that was originally created in vs 2005 and that was converted to vs 2008. When running this app in Windows 7, the menus don't look like the standard menus in Windows 7 (i.e., the formatting for the menu items is different than the formatting for other applications). This applies to menus displayed on the menu bar of the application as well as the right-click context menus. FYI, I am using the System.Windows.Forms.MenuStrip and the System.Windows.Forms.ContextMenuStrip controls.
Does anyone know why the menus aren't rendering with the default Windows 7 look and feel?
MenuStrip uses a custom renderer, it doesn't leave it up to Windows to draw the menu. You can change the RenderMode property to System but that doesn't help, it's a pre-Win7 version of what system-drawn menus looked like. If you want Windows to render the menu then you'll have to fall back to the .NET 1.1 MainMenu component. Another way is to assign the Renderer property to your own custom renderer, not really practical.
This is also an issue with WPF, worse because it renders all the controls itself. We are quickly approaching a stage where the look-and-feel of a program is determined by the UI class library, not the operating system.
If you have any OWNERDRAW items in your menus, Windows 7 will revert to a backward compatible drawing mode to avoid breaking your code. Do you override the drawing of any of the items?

Resources