private void button4_Click(object sender, EventArgs e)
        {
            if (listView2.SelectedIndices.Count > 0 && listView2.SelectedIndices[0] < listView2.Items.Count - 1)
            {
                LCDCharacter c = null;
                if (_areaIndex > -1)
                {
                    RS232LCDCharacter c1 = null;
                    RS232LCDCharacter c2 = null;

                    if (listView2.SelectedItems[0].Tag is RS232LCDCharacter)
                    {
                        c1 = (RS232LCDCharacter)listView2.SelectedItems[0].Tag;
                    }
                    else
                    {
                        c1 = new RS232LCDCharacter((LCDCharacter)listView2.SelectedItems[0].Tag);
                        _configuration.Areas[_areaIndex].Characters[listView2.SelectedIndices[0]] = c1;
                    }

                    if (listView2.Items[listView2.SelectedIndices[0] + 1].Tag is RS232LCDCharacter)
                    {
                        c2 = (RS232LCDCharacter)listView2.Items[listView2.SelectedIndices[0] + 1].Tag;
                    }
                    else
                    {
                        c2 = new RS232LCDCharacter((LCDCharacter)listView2.Items[listView2.SelectedIndices[0] + 1].Tag);
                        _configuration.Areas[_areaIndex].Characters[listView2.SelectedIndices[0] + 1] = c2;
                    }

                    int tmp = c1.Order;
                    c1.Set(c2.Order);
                    c2.Set(tmp);
                    c = c1;
                }
                else
                {
                    RS232LCDCharacter c1 = _characters[listView2.SelectedIndices[0]];
                    RS232LCDCharacter c2 = _characters[listView2.SelectedIndices[0] + 1];

                    int tmp = c1.Order;
                    c1.Set(c2.Order);
                    c2.Set(tmp);
                    ArrangeCharacters();
                    c = c1;
                }
                ShowCharacters();
                ShowCharactersOnLCD();

                listView2.SelectedItems.Clear();
                for (int i = 0; i < listView2.Items.Count; i++)
                {
                    if ((LCDCharacter)listView2.Items[i].Tag == c)
                    {
                        listView2.Items[i].Selected = true;
                        break;
                    }
                }
            }
        }
        private void lcdViewCtrl1_SelectingCharPositionEvent(object sender, LCDViewCtrl.SelectEventArgs e)
        {
            e.Proceed = false;
            LCD lcd = comboBox4.SelectedItem as LCD;

            if (lcd == null)
            {
                return;
            }
            e.Proceed = true;
            if (e.Select)
            {
                LCDCharacter c = new RS232LCDCharacter(lcd, (byte)e.CharPosition.Row, (byte)e.CharPosition.Column, listView2.Items.Count);
                if (_areaIndex > -1)
                {
                    List <LCDCharacter> cs = new List <LCDCharacter>();
                    cs.AddRange(_configuration.Areas[_areaIndex].Characters);
                    cs.Add(c);
                    _configuration.Areas[_areaIndex].Set(cs.ToArray());
                    _configuration.Areas[_areaIndex].ArrangeCharacters();
                }
                else
                {
                    _characters.Add((RS232LCDCharacter)c);
                    ArrangeCharacters();
                }
            }
            else
            {
                if (_areaIndex > -1)
                {
                    List <LCDCharacter> cs = new List <LCDCharacter>();
                    cs.AddRange(_configuration.Areas[_areaIndex].Characters);
                    int index = cs.Count;
                    while (index-- > 0)
                    {
                        if (cs[index].LCD == lcd && cs[index].Row == e.CharPosition.Row && cs[index].Column == e.CharPosition.Column)
                        {
                            cs.RemoveAt(index);
                            break;
                        }
                    }
                    _configuration.Areas[_areaIndex].Set(cs.ToArray());
                    _configuration.Areas[_areaIndex].ArrangeCharacters();
                }
                else
                {
                    List <RS232LCDCharacter> cs = _characters;
                    int index = cs.Count;
                    while (index-- > 0)
                    {
                        if (cs[index].LCD == lcd && cs[index].Row == e.CharPosition.Row && cs[index].Column == e.CharPosition.Column)
                        {
                            cs.RemoveAt(index);
                            break;
                        }
                    }
                    _characters = cs;
                    ArrangeCharacters();
                }
            }
            ShowCharacters();
            ShowCharactersOnLCD();
        }