Can I move selected text left and right in visual studio 2019? - visual-studio-2019

I'm hoping this question doesn't get deemed as a duplicate, as my question pertains to Visual Studio 2019. Not VS Code. - Move selected text to the left or right in Visual Studio Code
Is there a key binding I can use that will allow me to move any selected text in a line, left and right? Additionally to that, would it also be possible to send selected text to the start or end of a line (like Home and End key does to the cursor)
If this is possible, it would be a very handy shortcut for me to make use of. Thanks in advance.

In VS-2022, first highlight the lines you want to move, then...
to move to the right, press the TAB key. (note, that you're highlighting only 1 row, then ensure that you highlight the entire row)
to move to the left, hold SHIFT key, then (while still holding SHIFT)
press TAB key. (now release SHIFT)

Related

When typing at the end of the editmask, it will pass the number to the left side until it reaches the last one

Good afternoon,
I'm doing a project in delphi that uses editmask. I'm using the phone mask.
When clicking on edit to write the phone number, it goes to the last field on the right, so it is necessary to go back with the backspace to the beginning of the edit on the left.
i would like to find a way that when the user typed the number in the last field on the right, it was passed to the left. So on until you complete the phone field. It would be possible?
Using an example of what it would look like:
I couldn't think of a way to do it
The component is called TMaskEdit.
Just like anything that bases on TEdit putting the focus onto the control will by default put the text cursor at the end of its content
via keyboard, should .AutoSelect be FALSE and
via mouse if clicking behind any text (by default the text is aligned to the left).
You should have experienced this with the other components already. If you want the text cursor to always be at a certain position upon focusing the control, then do that in such an event handler:
for keyboard use OnEnter:
procedure TForm1.MaskEdit1Enter(Sender: TObject);
begin
(Sender as TMaskEdit).SelStart:= 1; // Second position
end;
and for mouse use OnClick with the same code.
It even works unbound to how the property .AutoSelect is set.
Using Backspace is the worst choice input wise, as it always deletes potential content and needs to be pressed several times to go to the first position. Why not using the Home key instead?

How do I 'revert to inherited' if control is not clickable?

Assume the following situation:
FrmBase has a TPanel named PnlClient, align alClient
FrmDescendant inherits from FrmBase
In FrmDescendant I change a PnlClient property
In FrmDescendant I place another control (say another TPanel named PnlDescendant) on PnlClient and align it alClient.PnlDescendant now completely covers PnlClient
I place lots of other components on PnlDescendant, not necessarily aligned, so I'm afraid to change PnlDescendant (e.g. setting align to alNone and resizing) and lose positions
How can I execute 'revert to inherited' for PnlClient?
There's nothing in the main menu, or in the popup menu for the controls in the Structure View...
Currently using Delphi 10.4.1 Sydney
This is easy for a keyboard user like myself:
Click on PnlDescendant in the form editor to make it the focused and selected control.
Press Esc to select its parent, PnlClient.
Press the Menu key on your keyboard to display the context menu of PnlClient. If you have a cheap keyboard without a Menu key, press Shift+F10 instead.
Click on "Revert to Inherited". (Or, much faster: press the menu item's underlined character, probably I.)
(But notice that this will remove PnlDescendant completely. Probably you didn't want that, but that's how it works.)

At design time, can you prevent components from moving on the first selection click?

All of our forms tend to have things get a few pixels out of place because when we click a component to modify the properties, there is a tendency to have the component move if the mouse is still moving the tiniest bit when we select a component.
Is there a setting that makes it so you can't move a component that isn't already selected? (Requiring a second intentinoal click to actually move things.)
You can enable "Lock controls" from the "Edit" menu, then it won't move when you click it, but it will of course remain locked also at the second click.
However, at least it will save you from the accidental moves just because you need to select the control
I find uncheck (use designer guidline) can prevent the problem,
but you will not see the alignment line.
tools->options->Form Designer

Cause 'hint' to refire on listview as I move over items

Sure I've seen this done before but off-hand I can't find any examples.
I've got a TListView, set in 'report' viewstyle. It has about half a dozen subitems, and one thing we'd like to do is have the 'hint' (tooltip) on the listview dynamically show another field of data. That is, each time you move the mouse over any given row, the 'hint' would show some text relevant to that particular row.
I'm partway there - I can do this using the OnInfoTip method, but unfortunately once a tip has appeared, Windows seems to decide that I don't need to see a hint for the listview again until I move the mouse away from the listview and then back 'over' it again. Simply moving the mouse down to the next row, all-the-time keeping the mouse over the control, doesn't persuade the program to display the new hint.
Just to be clear - I've got OnInfoTip working so that the program does display the right hint relevant to the item I first moved the mouse over. Changing the hint text isn't the issue. The problem is that moving the mouse to another item in the listview doesn't cause the software to show a new hint. (Hope that makes sense).
Is there some proper way of getting this behaviour to work, or am I going to end up doing something icky with mouseovers and then manually drawing a hintbox (etc)?
check the following link:
Display Custom Hints for TListView Sub Items
Edit:
I just checked it now on delphi7 it's showing the hint for every row dynamically after moving the mouse on the listview.
Offtopic: This is simple in Virtual Treeview component, it is build-in feature.
i was using the OnInfoTip event (i didn't need hints for the subitems). the hint was "flashing" (show/hide/show/hide/show/hide/show/hide). found the listview's ShowHint was false. set it to True and it worked as it should.

Delphi 2009 IDE Structure View Collapse function

Does anyone know now to collapse all items in Delphi 2009 IDE structure View?
I have no idea to collapse all items and that make me hard to find my class from the view.
Thanks.
Select root node (Classes) and press / (divide sign) on the numerical keypad. That will collaps everything. Then press + (plus) key on the numerical keypad and first level will expand.
You can also play with - (minus, collapses everything but + will expand everyhing, not only the first sublevel) and * (multiply, expands everything).
Left arrow key works the same as - and right arrow key works the same as +.
Those shortcuts work the same in Windows native tree control (for example the one in the Registry Editor) and are pretty much universally useful for Windows applications that are displaying tree structure.

Resources