By default, the taskbar is locked, so you can’t resize or move it by dragging and dropping until it remains so.
You can lock or unlock the taskbar by selecting the “Lock the taskbar” option in the context menu.
Note: If the option is checked, the taskbar is locked.
Enable (to lock) or disable (to unlock) the toggle switch beneath the “Lock the taskbar.” You can find this one above “Automatically hide the taskbar in desktop mode.”
Before proceeding, I recommend taking a backup of the Registry.
Go to the following: HKEY_CURRENT_USER > Software > Microsoft > Windows > CurrentVersion > Explorer > Advanced.
Locate TaskbarSizeMove and double-click it.
Enter 0 if you want to lock the taskbar and 1 if you want to unlock it in the Value data field.
Hit the OK button.