| Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате |
| Форум программистов > Разработка Windows Forms > VisualStyleRenderer |
| Автор: senalex 27.5.2009, 07:21 |
| Всем привет, Стояла задача вывода итогов в datagridview, решил ее прорисовкой, под каждой колонкой, TextBox'а. Делал так: using System.Windows.Forms.VisualStyles; TextBoxRenderer.DrawTextBox(e.Graphics, new Rectangle(grid.GetColumnDisplayRectangle(col.Index, true).X, grid.Height - grid.RowTemplate.Height - grid.RowTemplate.Height + 5, grid.GetColumnDisplayRectangle(col.Index, true).Width, grid.RowTemplate.Height), "Сумма: " + sum[col.DataPropertyName.ToLower()].ToString(), grid.Font,TextFormatFlags.Right | TextFormatFlags.TextBoxControl, TextBoxState.Normal); Все работает нормально только под стилем XP, при классическом стиле выдает ошибку: Visual Styles-related operation resulted in an error because no visual style is currently active. Как быть? |