Is there a way to copy FormDesign appearance from one button to the next? - visual-studio-2013

So I created a lot of buttons (a-z). Unfortunately, when I reopened the document later, they're all blacked out and I'm having to go through and individually change the buttons appearance one at a time.
Is there a 'format painter' of some kind in visual studio express so that I can just change one's appearance, then copy that over to each next button?

The Windows Forms, WPF and other UI designers in Visual Studio allow you to select multiple controls at once, by Ctrl+Click, Shift+Click or by dragging a selection ("rubber band") rectangle around the relevant controls.
Once you've done that, the properties editor displays those properties that the controls have in common. Changing a property changes it for all of the selected controls.

Related

Visual studio resolution

I was making a form on visual studio and didn't realise that my resolution was at 300% as I was working off a TV, all my items appeared scrunched together so I reset them in the correct positions however now some of them are off the edges of the form and I cant stretch it past a certain point in order to move them back. Is there a way I could get them without having to remake it?
What version of Visual Studio are you using? In the latest versions you can use the Document Outline pane/window (View->Other Windows->Document Outline, Ctrl-Alt-T may also display it).
In that window, with the form displayed, it will list all the controls in the form. Find the ones you need, right-click on them and select Properties.
Now the Properties window should be showing the properties for that control. You should now be able to edit the Location there to adjust where the control is posistioned.

How to give the focus (back) to my Visual Studio tool window

My project is a Visual Studio Extension which has a tool window. The tool window contains a grid control. A line in the grid corresponds to some part of a source code file, XAML file, ASP file or WinForms UI.
When you click in a cell in the grid, I want to find the corresponding think in your project, open it, select it, but afterwards I want the focus to be in the cell where you originally clicked, in the grid, in my tool window.
This used to work, but it is not working in my current version, in particular after selecting text in a XAML file.
To select text in the XAML file, I
start with the ProjectItem
open the corresponding window
activate it with window.Activate()
get the TextDocument object
manipulate the TextDocument.Selection to select text
After that I set the focus back to my tool window, by
casting the ToolWindowPane to IVsWindowFrame
calling the show method IVsWindowFrame.Show()
possibly setting the focus to a specific control in my tool window (but that is not really relevant)
I have made (at least) three significant changes:
I am using Visual Studio 2019
I am using async and await at a lot of places (but still running on the main thread)
My top level control is now a WPF control. Formerly it was WinForms
Maybe Visual Studio 2019 is doing something asynchronous in the XAML window, which was previously synchronous. This might mean that I set the focus back to my tool window, but lose it again immediately.
Is there a better way to force the focus back to my tool window?
Alternatively, is there some event I should wait for, before calling IVsWindowFrame.Show()?

Add TabPages to Tab Control in Visual Studio 2010 Designer

I'm using Visual Studio 2010 Professional, and created a WTL Project (Dialog). In this dialog, I inserted a Tab Control via the Toolbox. However, after placing it on the dialog window in the Designer/Resource Editor, I just can't add any tabs. There are several issues:
In some video tutorials and the MSDN, it says that the Tab Control starts with two tabs, which switch when clicked. However, the Designer shows five tabs, which don't switch when I click them.
Aforementioned tutorials also suggest to edit the TabPages property in the property pane. However, I can't find such a property in the property pane.
When running the Test Dialog (found in the Format menu), the five tabs are visible, and they are also focused/switched when clicked. However, running the program, there's only the plain Tab Control pane without any tabs (white square).
How can I add a Tab into the Tab Control via the Designer, i.e. not dynamical?
Let's be good stackoverflowers and answer the question properly.
The visual basic tutorials do not show the same dialog resource editor you are using for your WTL project. Although, the video tutorial that is most closely related shows how to add a tab control using this editor; it does so by altering the MFC code. It runs the program to show the result; it does not show the tab inside the resource editor.
Thus, the conclusion is that tabs cannot be added using the dialog editor on its own.

Using old toolbars in Excel 2010 and Windows 7

I have a toolbar with some actions linked to macros in Personal.xls. I want to use the toolbar in Excel 2010 under Win7, but it insists C:\Documents and Settings\user\App...\PERSONAL.XLS doesn't exist. Quite right, they've changed the %AppData% location to C:\Users\user... And I can't put a copy of PERSONAL.XLS in the old place because C:\Documents and Settings\ is special-cased in Windows 7, and it's a forbidden place to everyone.
My question: How can I reset the macro linked to the toolbar buttons?
You used to be able to access
the Commandbars collection to get a command bar
The Controls collection of the command bar to get a control (button in this case)
The OnAction property of the control to identify the linked macro.
But OnAction doesn't seem to be a supported property for Excel 2010.
Any suggestions?
I'd much rather relink the toolbar than create a new custom ribbon tab. The toolbar buttons don't waste the APALLING amount of space custom ribbon items take up, and the custom icons on my toolbarare meaningful. Subsiduary question: Are there simple ways to create custom designs for custom ribbon items?
Looks like I didn't investigate closely enough. "OnAction" might not appear in the Object Browser, but it is available, and can be used to reset the associated toolbars. It didn't seem to work using the Immediate window, but does work within code in a module.
Cheers folks...

VS2010: Why do my custom Toolbox tabs and contained controls keep disappearing?

This is how I expected the toolbox to work:
Let's say I add a custom Tab to the Toolbox called "Ajaxtoolkit." To add controls to the new tab, I right mouse click and select "Choose Items" and browse to a file, Ajaxtoolkit.dll, that is of a particular version number.
I would expect that when I save and reopen the solution, that the Ajax Toolkit custom tab would still be in my Toolbox and that it would contain the same controls that were there last time, the controls that were in the dll that I referenced when the controls were added.
If I created a brand new web app, I (possibly) wouldn't expect to see the same Ajax Toolkit custom tab. However, I could perform the same steps as above and add a "Ajax Toolkit" tab and perhaps, this time, select a DIFFERENT VERSION of the tookit, and the state of the toolkit would be retained with each solution file.
Another possibility would be for the original Ajaxtoolkit to be retained when the 2nd web solution is created, and perhaps, if I wanted to mix versions of the toolkit across diffreent web sites in my solution, I should start naming my custom toolkit tabs with version specific names like "Ajaxtoolkit 4.0," etc.
...But instead, the Ajaxtoolkit tab disappears when I close VS2010 and reopen it.
Why? Is this desirable behavior or a bug?
You know VS2010 is a fully customizable IDE, may be these features conflicts your toolbox customization.

Resources