예제 #1
0
        private void listBoxControl1_MeasureItem(object sender, MeasureItemEventArgs e)
        {
            ListBoxControl control  = (ListBoxControl)sender;
            string         text     = control.GetItemText(e.Index);
            Size           textSize = TextUtils.GetStringSize(e.Graphics, text, control.Appearance.Font,
                                                              StringFormat.GenericDefault, control.ClientRectangle.Width);

            e.ItemHeight = textSize.Height + 5;
        }
예제 #2
0
        private void listBoxControl1_DrawItem(object sender, ListBoxDrawItemEventArgs e)
        {
            ListBoxControl control = (ListBoxControl)sender;

            e.Appearance.DrawBackground(e.Cache, e.Bounds);
            TextUtils.DrawString(e.Graphics, control.GetItemText(e.Index), control.Appearance.Font,
                                 control.Appearance.ForeColor, e.Bounds);
            e.Handled = true;
        }
예제 #3
0
 /// <summary>
 /// Show popup when user right click in list card control
 /// </summary>
 private void listCard_Click(object sender, EventArgs e)
 {
     try
     {
         ListBoxControl listBox = (ListBoxControl)sender;
         cardIndex = listBox.SelectedIndex;
         cardNo    = listBox.GetItemText(cardIndex);
         MouseEventArgs me = (MouseEventArgs)e;
         if (me.Button == MouseButtons.Right)
         {
             popupDeleteCard.ShowPopup(Control.MousePosition);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }