-
第三方控件使用大全
一、
ComboBoxEdit
1
、
如何使其不可编辑
TextEditStyle
设置为:
DisableTextEditor
2
、
如何设置鼠标为手形
Cursor
设置为:
Hand
二、
GridControl
1
、
如何解决单击记录整行选中的问题
View->OptionsBehavior->EditorShowMode
设置为:
Click
2
、
如何新增一条记录
(1)
、
Row()
(2)
、实现
gridView_InitNewRo
w
事件
3
、
如何解决
GridControl
记录能获取而没有显示出来的
问题
teColumns();
4
、如何
让行只能选择而不能编辑(或编辑某一单元格)
(1)
、
View->OptionsBehavior->EditorShowMode
设置为:
Click
(2)
、
View->OptionsBehavior->Editable
设置为:
false
5
、如何禁用
GridControl
中单击列弹出右
键菜单
设置
Run
Design->OptionsMenu->EnableColumnMenu
设置为:
false
6
、如何隐藏
GridControl
的
GroupPanel
表头
设置
Run
Design->OptionsView->ShowGroupPanel
设置为:
false
7
、如何禁用
GridControl
中列头的过滤器
过滤器如下图所示:
设置
Run
Design->OptionsCustomization->AllowFilter
设置为:
false
8
、如何在查询得到
0
条记录时显示自定义的字符提示
/
显示
如图所示:
方法如下:
//When no
Records Are Being Displayed
privatevoid
gridView1_Custom
DrawEmptyForeground(
object
sender,
CustomDrawEventArgs
e)
{
//<
/p>
方法一(此方法为
GridView
设置
了数据源绑定时,可用)
ColumnView
columnView = sender as ColumnView;
BindingSource bindingSource = urce as
BindingSource;
if( == 0)
{
string str =
没有查询到你所想要的数据
!
Font f = new
Font(
宋体
Rectangle r = new Rectangle( + 5, + 5,
- 5, - 5);
ring(str, f, , r);
}
//
方法二(此方法为
GridView
没有设置数据源绑定时,使用,一般使用此种方法)
if
(
this
._flag)
{
if
(
this
.nt == 0)
{
string
str =
p>
没有查询到你所想要的数据
!
;
Font
f =
new
Font
(
宋体
, 10,
FontStyle
.Bold);
Rectangle
r =
new
Rectangle
( +
5, + 5, -
5, - 5);
ring(str, f,
Brushes
.Black,
r);
}
}
}
9
、如何显示水平滚动条?
设置
AutoWidth = false;
10
、如何定位到第一条数据
/
记录?
设置
rst()
11
、如何定位到下一条
数据
/
记录?
设置
xt()
12
、如何定位到最后一条数据
/
记录?
设置
st()
13
、设置成一次选择一行,并且不能被编辑
ectStyle =
us;
le
= false;
AppearanceFocusedCell = false;
14
、如何显示行号?
this
.torWidth =
40;
//
显示行的序号
privatevoid
gridV
iew1_CustomDrawRowIndicator(
object
sender,
RowIndicatorC
ustomDrawEventArgs
e)
{
if
(ndicator && dle>=0)
{
yText = (dle +
1).ToString();
}
}
15
、如何让各列头禁止移动?
设置
olumnMoving =
false;
16
、如何让各列头禁止排序?
设置
ort = false;
17
、如何禁止各列头改变列宽?
设置
olumnResizing = false;
18
、
19
、
20
、
21
、
22
、
23
、
24
、
25
、
26
、
三、
navBarControl
1
、如何在每一个
navBarGroup
里添加自己想要的控件
设置
GroupStyle:
ControlContainer
2
、如何设置
navBarGroup
有滚动条
设置<
/p>
SkinExplorerBarViewScrollStyle:ScrollBar
3
、
如休把
navBarGroup
设置成如下样式
如图所示:
设置<
/p>
navBarGroup
的
PaintS
tyleName
属性为
:
SkinNavigationPane
四、
toolTipController
效果图如下:
1
、如何设置显示的时间长短
设置
this
.pDelay =
2000;
2
、如何在屏幕上显示如上图所示的效果
ToolTipControllerShowEventArgs<
/p>
args =
this
.ShowArgs();
this
.lTip(
this
.sb
tnYes,
请选择一条记录
!
p>
);
this
.le(
< br>this
.sbtnYes,
提示
); <
/p>
this
.lTipIconType(
this
.sbtnYes,
.
To
olTipIconType
.Exclamation);
this
.ak =
true
;
this
.adow =
true
;
this
.d =
true
;
this
.nt(
请选择一条记录
!<
/p>
,
提示
);
p =
请选
择一条记录
!
;
=
提示
;
3
、如何设置边框的颜色
this
.Color =
Color
.Red;
五、
TextEdit
1
、如何设置
TextEdit
为多行,可拉伸
p>
设置
Te
xtEdit
的
Propertity->AutoHeigh
t
为:
False
六、
LayoutControl
1
p>
、如何设置
LayoutItem
为隐藏<
/p>
设置
lity
= Never
七、
TreeList
1
、如何隐藏
TreeList
的列头
< br>设置
TreeListr
的
Op
tionsView
的
ShowColumns
属性为:
False
2
、如何
八、
PictureEdit
1
p>
、如何禁止
PictureEdit
的右键
菜单?
设置
PictureEdit
的
Properties->ShowMenu
为:
false
九、
TreeList
1
、
如何让
TreeList
的每个结点高亮显示?
效果如下:
代码如下:
privatevoid
treeList1_Custom
DrawNodeCell(
object
sender,
eeList.
CustomDrawNodeCellEve
ntArgs
e)
{
TreeList
node = sender
as
TreeList
;
if
( == dNode)
{
p>
ctangle(
SystemBrushes
.Window, );
Rectangle
r =
new
Rectangle
(,
,
Convert
.ToInt32(eString(xt,
).Width + 1),
Convert
.ToInt32(eString(xt,).Height));
p>
ctangle(
SystemBrushes
.Highlight, r);
ring(xt, ,
SystemBrushes
.HighlightText,
r);
d =
true
;
}
}
//=
==================================================
=========================
//===========
====================
以下内容为收集
=
==============================
//======
==================================================
====================
一、改变
p>
grid
的样式。
.
XAppearances
xapp;
xapp=
new
.
p>
XAppearances
(System.
Environment
.GetFolderPath(System.
Envi
ronment
.
SpecialFolder
.System) +
);
he
me(
“
样式名字
”
< br>, ew);
二、选择单元设置和取所选的值
ele
ctMode=
GridMultiSelectMode
.C
ellSelect;
electMode=
GridMul
tiSelectMode
. RowSelect; //
elect = d; //
多行选择
三、
gridview
的控制
///<
取当前选中的值
>
string
GetSelectedRows(
GridView
view) {
string
ret =
;
int
rowIndex = -1;
if
(electMode
==
GridMultiSelectMode
.RowSe
lect) {
foreach
(
i
nt
i
in
ectedRows()) {
DataRow
row =
aRow(i);
if
(ret !=
) ret +=
;
ret +=
string
.Format(
, row[
], i);
}
}
else
{
foreach<
/p>
(
GridCell
cell
in
ectedCells()) {
if
(rowIndex != dle) {
if
(ret !=
) ret +=
;
ret +=
string
.Format(
, dle);
}
ret +=
+ CellDisplayText(dle,
);
rowIndex = dle;
}
}
return
ret;
}
///<
设置选中的颜色
>//
半透明的效果
privatevoid
icbTranslucentCo
lors_CheckedChanged(
object
sender, System.
EventArgs
e)
{
if
(d) {
lor =
Color
.FromArgb(30, 0,
0, 240);
lor =
Color
.FromArgb(60, 0, 0,
240);
}
else
{
();
();
}
}
///<
自动添加一行
>
mRowPosition =
NewItemRowPo
sition
.Bottom//Top/None;
///<
设置
gridView
的按钮
>
ttonMode =
ShowButtonModeEnum.
。。。。。。
le = d;
//
设置按钮是否可用
///
向选中的空间输入字符串
p>
SendKeys
.Send(
“
fsfds
”
);
///
控件焦点
();
四、
cardView
的设置
///
是否现实快捷按钮
CustomizeButton
ickCustomizeButton=true/false;
< br>///
设置
CustomizeButton
的能否排序和过滤
foreach
(
GridColumn
col
in
s)
{ ort}
p>
foreach
(
GridColumn<
/p>
col
in
s)
{ ilter}
///car
d
的头上的
ico
显示
Changed();
///card
的头上的标题改变显示
ptionFormat =
””
;
///cardview
显示的单个记录的折叠按钮
rdExpandButton=true;
///
mCardColumns =iSize
mCardRows = val;
rzWidth
///
多选
elect = d;
forea
ch
(
int
i
in
ectedRows()) {
DataRow
row = aRow(i);
if
(ret !=
) ret +=
;
ret
+=
string
.For
mat(
/
{1}
:
{2:$$#,0.00}
,
row[
],
row[
],
row[
]);
}///
查看选择中的记录
CellMerging(
单元格合并的效果
)
///
CellMerging(
单元格合并的效果
)
-
-
-
-
-
-
-
-
-
上一篇:德语生物化学词汇表
下一篇:(完整版)initializega函数代码