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.
Related
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()?
I'm in the process of migrating some Web Sites to Web Applications, using Visual Studio 2017. One thing I can't seem to figure out is how do I open multiple .cs files at the same time? I can open the .aspx file for them easy enough by right clicking and choosing Open. I can view the code behind on a single page at a time by right clicking and choosing View Code. In the old Web Sites I could right click multiple files at once and select View Code, however, it appears in Web Applications that option has been replaced with "View Code Gen File" which isn't the same thing. It's painfully slow to open a single page at a time so hopefully there is a setting I am just not finding.
EDIT: As requested, uploading screenshots. Only .aspx files are selected but when more than one is selected the "View Source" option is no longer there. Also I should note that if multiple are selected in Solution Explorer, pressing F7 also has no effect, though that keystroke does work to View Source of a single file at a time.
After further experimentation, I now see what you see and I agree that it's something that Microsoft broke along the way. In fact, in your own image, if you single-select an aspx file in Solution Explorer then you can see the "<>" icon appear in the button bar at the top of Solution Explorer. But that icon disappears whenever you select two or more aspx files.
I've done a lot of work with Visual Studio over the years and I can't imagine any justifiable reason why Microsoft would have deliberately removed the View Code option from the context menu for multiply selected aspx files.
This appears to be a bona fide bug that should be reported to Microsoft.
Meanwhile, as a workaround, use the File | Open option in Visual Studio 2017 and, in the resulting Open File dialog box, simply multi-select any .cs files you need (this dialog box allows you to multi-select files and open all of them at once).
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.
In Eclipse when you click twice on the tab of the editors Eclipse hide all other windows except the one you write code in and when you do that again(clicking the tab of the document all windows comeback again).
Is there a similar feature in Visual Studio 2013?
Update: I found Auto Hide in Window Menu, but I don't want auto hide, I want to click something to hide windows and click again to show them.
As a programmer i love shortcut keys which is very helpful for productive work. I've search question as you mentioned. But i did not get proper answer. then i've searched solution for me which might helpful to you.
Step 1: Go to visual studio
Step 2: From tool menu open Options menu
Step 3: Go Environment -> Keyboard
Step 4: Select item Window.AutoHideAll from list
Step 5: Set short cut in "Press shortcut keys textbox". I've set Ctrl+Alt+] then click on Assign & then ok.
Step 6: Final step. Use above shortcut to hide all window other than editor window.
View | Full Screen
(In my key bindings: shift+ctrl+enter.)
However, double clicking on an editor tab also works, this is provided by one of the extensions I use, but I'm not sure which.)
Richards answer does work, but has the side effect of maximizing the whole of Visual Studio as well. Sometimes (e.g. when comparing editor text to some other text), I would like Visual Studio to only take half the screen. A solution I found in Visual Studio 2019 was:
Window | Save Window Layout (call it something like Normal layout)
Unpin all the other panes you don't want to see, ToolBox, Solution Explorer, Build Results etc. Typically Left, Right and Bottom
Window | Save Window Layout, call it say maximized Editor.
Window | Apply Window Layout, you can choose Normal or Maximized editor
Visual Studio assigns these shortcut keys automatically of Ctrl+Alt+1 and Ctrl+Alt+2 to the first two Apply Window Layout choices
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.