private void setTime_Click(object sender, EventArgs e) { int localTime = (int)((timePicker.Value.Ticks - new DateTime(1970, 1, 1).Ticks) / 10000000); Cursor.Current = Cursors.WaitCursor; int result = BSSDK.BS_SetTime(m_Handle, localTime); Cursor.Current = Cursors.Default; if (result != BSSDK.BS_SUCCESS) { MessageBox.Show("Cannot set the time", "Error"); return; } }