private void btnMemoX_MouseDown(object sender, MouseEventArgs e) { // check if we should NOT save a a memory-position istead of moving to it if (!DoSaveMemoPosition) { string ButtonName = ((Button)sender).Name; // calculate the memory-position-number from the buttons end-number VirtualHandset.MemoNumber MemoNumber = (VirtualHandset.MemoNumber)Convert.ToInt32(ButtonName.Substring(ButtonName.Length - 1, 1)) - 1; // begin moving to the memory-position x Handset.BeginMove(MemoNumber); } }
private void btnMemoX_Click(object sender, EventArgs e) { string ButtonName = ((Button)sender).Name; // calculate the memory-position-number from the buttons end-number VirtualHandset.MemoNumber MemoNumber = (VirtualHandset.MemoNumber)Convert.ToInt32(ButtonName.Substring(ButtonName.Length - 1, 1)) - 1; // check if we should save a a memory-position istead of moving to it if (DoSaveMemoPosition) { // display "S 1" to "S 6" on the handset txtHandsetDisplay.Text = "S " + ((int)MemoNumber + 1); // save the memory-position x Handset.SaveMemoryPosition(MemoNumber); // NOTE: we don't clear the DoSaveMemoPosition flag here, // because we get the MouseDown-event after the Click-event! } }