Esempio n. 1
0
        private void listViewCmds_DoubleClick(object sender, EventArgs e)
        {
            EditOprosCmdForm frm = new EditOprosCmdForm();

            int index = listViewCmds.SelectedIndices[0];

            frm.comboBoxAddress.Text = string.Format("{0:X2}", block.Cmds[index].Address);
            frm.comboBoxSize.Text    = string.Format("{0:X2}", block.Cmds[index].SizeBuffer);;

            ListViewItem item = listViewCmds.SelectedItems[0];

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                item.SubItems[1].Text = frm.comboBoxAddress.Text;
                item.SubItems[2].Text = frm.comboBoxSize.Text;

                block.Cmds[index].Address    = byte.Parse(frm.comboBoxAddress.Text, NumberStyles.AllowHexSpecifier);
                block.Cmds[index].SizeBuffer = byte.Parse(frm.comboBoxSize.Text, NumberStyles.AllowHexSpecifier);
            }
        }
Esempio n. 2
0
        private void listViewCmds_DoubleClick(object sender, EventArgs e)
        {
            EditOprosCmdForm frm = new EditOprosCmdForm();

            int index = listViewCmds.SelectedIndices[0];

            frm.comboBoxAddress.Text = string.Format("{0:X2}", block.Cmds[index].Address);
            frm.comboBoxSize.Text = string.Format("{0:X2}", block.Cmds[index].SizeBuffer); ;

            ListViewItem item = listViewCmds.SelectedItems[0];

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                item.SubItems[1].Text = frm.comboBoxAddress.Text;
                item.SubItems[2].Text = frm.comboBoxSize.Text;

                block.Cmds[index].Address = byte.Parse(frm.comboBoxAddress.Text, NumberStyles.AllowHexSpecifier);
                block.Cmds[index].SizeBuffer = byte.Parse(frm.comboBoxSize.Text, NumberStyles.AllowHexSpecifier);
            }
        }