예제 #1
0
 private RadListBoxItem BuildRadMenuContentItem(object tag, String name, String description, Image image, Size size, Font nameFont, Font descriptionFont, Telerik.WinControls.ElementVisibility separatorVisibility)
 {
     return(BuildRadMenuContentItem(tag, name, description, image, size, nameFont, descriptionFont, separatorVisibility, true));
 }
예제 #2
0
        private RadListBoxItem BuildRadMenuContentItem(object tag, String name, String description, Image image, Size size, Font nameFont, Font descriptionFont, Telerik.WinControls.ElementVisibility separatorVisibility, bool selectable)
        {
            RadListBoxItem tmplContactListItem = new Telerik.WinControls.UI.RadListBoxItem();

            tmplContactListItem.AutoSize     = true;
            tmplContactListItem.AutoSizeMode = Telerik.WinControls.RadAutoSizeMode.Auto;
            tmplContactListItem.Size         = size;

            tmplContactListItem.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
            tmplContactListItem.DisplayStyle      = Telerik.WinControls.DisplayStyle.ImageAndText;
            tmplContactListItem.Image             = image;
            tmplContactListItem.ImageAlignment    = ContentAlignment.MiddleCenter;
            //
            // tmplContactListItem
            //
            tmplContactListItem.AccessibleDescription = name;
            tmplContactListItem.CanFocus        = true;
            tmplContactListItem.Text            = " " + name.Trim();
            tmplContactListItem.DescriptionText = " " + description.Trim();

            tmplContactListItem.ForeColor = System.Drawing.Color.Black;

            tmplContactListItem.TextSeparatorVisibility = separatorVisibility;

            tmplContactListItem.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;

            tmplContactListItem.Font            = nameFont;
            tmplContactListItem.DescriptionFont = descriptionFont;
            tmplContactListItem.Tag             = tag;

            tmplContactListItem.ToolTipText = null;



            tmplContactListItem.Enabled = selectable;

            tmplContactListItem.DoubleClick += new EventHandler(tmplContactListItem_DoubleClick);

            return(tmplContactListItem);
        }