Is there a way to switch tabs with CTRL+[NUMBER] instead of CTRL+TAB? - visual-studio-2017

I am using Visual Studio Community 2017 and am frequently switching between several class files. The way I am having to do this is by pressing Ctrl+Tab (or Ctrl+Shift+Tab) repeatedly until I reach the desired tab.
It would be more convenient if there was a way to switch between tabs by pressing Ctrl+(tab's index) similar to how browser tabs are navigated. e.g. pressing Ctrl+1 opens the first/leftmost tab on your browser, Ctrl+2 opens the second one, etc.
Looking in Tools > Options > Environment > Keyboard, there are commands that use View.NavigateBackward and View.NavigateForward (The Ctrl+Tab and Ctrl+Shift+Tab functionality) that can be re-mapped - however nothing for the functionality I described above.
There are threads solving this issue for Visual Studio Code, however (and I'm really surprised/must be really dumb that) there are no threads that I could find for just Visual Studio.
Threads for Visual Studio Code:
Is there a quick change tabs function in Visual Studio Code?
https://github.com/Microsoft/vscode/issues/24753

You can switch to a specific tab with a keyboard shortcut with my Tabs Studio extension:
And you can additionally enable the Show tab numbers option to simplify usage of NavigateToTabXX commands:

So... After doing a more sensible search on StackOverflow instead of Google, I've found this thread;
https://stackoverflow.com/search?q=CTRL+Number+Visual+Studio
Which suggested to download a Visual Studio tool called "Hot Tabs". I have done so and it's working well for my purposes at the moment.
Hot Tabs

Related

How to enable all suggestions in intellisense all the time?

I am quite new to Microsoft Visual Studio. I am using VS Community 2019. I want to enable all suggestions in intellisense all the time, how can I do that?
For example, I have a vector variable v2qPenLine which is a QVector<QVector<QPen>>. The vector variable is named in such a way so that I have easy access to it through intellisense. When I try to use it inside setPen() method (which is expecting a QPen but not a vector of QPen I guess) the intellisense does not suggest this vector:
To have it suggested, I need to click on the + button at the bottom and then it suggests the correct variable immediately:
This behaviour is not convenient at all. How can I change this behaviour of the intellisense so that it suggests only based on the name and do it all the time so that I don't have to click the + button at the bottom of the suggestion list? I think there should be a setting for this and so I tried to look up the settings of intellisense but I was unable to change this behaviour. I also couldn't find any reference to this on the internet.
I think it is a problem of your VS IDE Intellisense. And you can see that the Intellisense of your environment does have any info about variables, functions, classes ....on the first time. It should show all types on the first time. In your side, it only has the type of methods, quite strange.
Try the following suggestions:
1) disable any third party extensions under Extensions--> Manage Extensions-->Installed to check if there is an extension which caused that.
2) close VS, delete all files under C:\Users\xxx\AppData\Local\Microsoft\VisualStudio\16.0_xxx\ComponentModelCache
3) reset all vs settings under Tools-->Import and Export Settings-->Reset all settings
4) close Vs, delete .vs hidden folder under the solution folder and then restart your project to test again.
5) repair vs or update it if there is a new release version

Visual studio MFC dialog editor seems broken on my HiDPI monitor - is this a known problem?

I am coding a C++ project using MFC in Visual Studio (v16.5.4). The dialog editor seems badly broken on my HiDPI monitor (Lenovo ThinkVision 2880x1800 at 175%). It works fine on two other computers with standard monitors.
The dialogs get resized apparently randomly, and controls do not move correctly when I try to edit them. When I try to align controls the dotted selection rectangle may move, but the control often does not (in the editor). Sometimes, re-opening the editor shows that the control has in fact moved. When I build the project, the final display layout cannot be predicted from what appears in the resource editor.
I reported this to Microsoft using Visual Studio feedback, but they closed the report, saying it was "By design"!!!! They posted a link describing a feature which disables HiDPI awareness, but the link was for the Windows Forms Designer, not the MFC resource editor - there is no equivalent feature in the latter that I could find.
Does anyone else have this problem, or know of a decent work-around? At the moment I am transferring to my other computer with the standard display whenever I need to edit a dialog, which is monumentally inefficient for quite a large project.
I know this is an older post, but I thought what I found might help someone. I experienced the same issue today. It just happens that I have one monitor setup for 125% and one setup for 100%. The MFC dialog editor alignment operations do not work correctly on the 125% monitor but work fine on the 100% monitor. It would appear Microsoft isn't properly handling DPI in the dialog editor.

Is there a command/hotkey to switch subpanes of a vertically split editor window in Visual Studio 2017?

Having split an editor window horizontally, I want to be able to switch back and forth between the 2 subpanes without using hotkeys. I haven't found which (if any) command would do this. If there is, I'll just use the predefined hotkey (if there is one).
I gather that VSCode already has predfined keys to switch between the subpanes of a window after splitting it, but can't find an equivalent in VS2017.
The answer is the command Windows.NextSplitPane; by default this is globally assigned as F6.

Visual Studio's bug: editor tabs (code tabs) appear->hide->appear forever => non-responsive

I love to open many tabs (10-30) of .cpp and .h, so the tab are overflowed to the right, i.e. Visual Studio can't show named of all opened tabs at the same time. (which is ok)
When I pin a new tab or change Visual Studio resolution (resize its window), Visual Studio will try to determine which one should be shown and which one should not (that is what I think).
In rare cases (1%), Visual Studio fail to do so. After I pin a new code tab (e.g. .cpp), it loops forever. For example, in the image, it is possible that the last of the four tabs will appear -> hide -> appear -> ... so on (forever).
Visual Studio would try to update other GUI to match the appearance/disappearance of the tab (e.g. width of console pane ?).
Within about 1-3 seconds, if I don't resize the window, Visual Studio will become unresponsive.
I will have to terminate it, lose some of my work.
It is like a mini-game.
I am sure that is a bug of Visual Studio. Have anyone faced it?
(Please comment if you faced the same problem!)
I don't think it is related to plugin "Visual Assist" or "Resharper".
I always set my monitor to low-resolution (1280 x 720), but I don't think it is a problem.
Question: How to solve this swappy bug, or at least avoid/alleviate it?

How to disable autoclosing of a dialog-based MFC application in Visual Studio?

When I start the program, I get the dialog and everything. But it closes by itself after some 10 seconds. How do I disable that?
EDIT: This happens when I run "Debug -> Start Without Debugging". This is the only way I know how to run the program.
EDIT2: My dialog is inheriting from CDialogEx.
If your dialog is not modal, i.e. you are not firing it up using the DoModal() member function, it is possible that it is being created with the constructor, and deleted with the destructor as it goes out of scope. You see this type of behaviour with some implementations of splash screens. To figure out what is happening, put a breakpoint on your dialogs destructor, and look at the call stack that is leading to it. It is also worth turning on all exceptions in the debugger, as you could be getting hit with an uncaught exception that is terminating your app.
As others have already said, this is not normal behaviour for an MFC app.
Usually dialogs do not behave that way.
But in default, they close on OnOk (CDialog::OnOk) which is "Enter Key Pressed"
and OnCancel (CDialog::OnCancel()) which is "Esc Key Pressed"
Try overloading those two in your Dialog, to see if those get called and to handle
the behaviour there as you like it.
Perhaps the Close event should also be handled or watched.
here are lots of examples of what can be done with a Dialog (especially OnOk, OnCancel and Close) CDialog Examples
I was facing the same issue with Visual Studio 2013:
I was creating the most basic MFC application with the Visual Studio wizard (either dialog-based, Single/Multiple document based), and just recompiling the generated code. No modification to the code at all.
I just found out that the "restart" does not occur when I turn off my Anti-virus. :-)
This is not a bug in Visual Studio, it is an environment problem.
My anti-virus is Avast.
The solution for Avast is to turn-off the Deepscreen feature.
There, go to Settings / Active Protection / Deepscreen - and disable that.
More details could be found about this approach to the solution on Avast's forums, from this discussion:
https://forum.avast.com/index.php?topic=139935.0
Confirmed, this happens with Visual Studio 2010, and doesn't happen with Visual Studio 2008. That means all the negative votes were completely unnecessary. It's a default of Visual Studio 2010, I didn't change anything. Nor did I make any bug, because I explicitly said that I created a new application without changing anything.
Thanks for all the negative votes.
Just for the record, I tried this using Visual Studio 2010. I picked Dialog-based application and left all the other options at their default settings. Compiled both Debug and Release configurations, for x86 and x64. When launched using Start without Debugging none of the four executables terminated by themselves.
If this is happening for you I would assume you have some application running (in the background) that interferes with the expected behavior. Try setting up a virtual machine, install a clean Visual Studio and perform the same procedure again.