Self-locking switch