If you are using a DX6i channel 5 is the best for switching between flight modes.
By default the Gear switch (marked red) is assinged to this channel. But this will only allow us to change from flight mode Position1 to Position 3.
#define POSITION_1 MANUAL // the default, don't bother changing. #define POSITION_2 STABILIZE #define POSITION_3 FLY_BY_WIRE_A
To also be able to switch to flight mode Position 2 you have to set up an extra mix. Go into the Adjust List and into the menu Mix1 or Mix2 and enter the values as shown on the picture below:
After doing this you can use the Flap switch (marked green) to change into flight mode Position 2.
Note: With these settings you are in flight mode Position 2 as long as the Flap switch is activated. Changing the Gear switch will have no effect as long as Flap switch is bottom position. The Servo Travel Screen of the transmitter is very useful in confirming which switch position corresponds with desired mode. Position_2 corresponds with the largest PWM Tx output for this mixing arrangement while Position_3 is the medium output. Manual mode, both switches off, is of course the lowest PWM seen on this mixed channel.