UCCheckSelect.cs
2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Weld
{
public partial class UCCheckSelect : UCFilterTop
{
public UCCheckSelect()
{
InitializeComponent();
foreach (System.Windows.Forms.Control control in this.Controls)
{
control.LostFocus += new EventHandler(UCCheckSelect_LostFocus);
}
radioButton1.Checked = true;
}
int CheckedValue = 0;
string Filters = string.Empty;
private void UCCheckSelect_Click(object sender, EventArgs e)
{
radioButton1.Focus();
}
private void UCCheckSelect_LostFocus(object sender, EventArgs e)
{
if (this.DisplayRectangle.Contains(this.PointToClient(System.Windows.Forms.Control.MousePosition)))
{
return;
}
string NewFilterstr=string.Empty;
if (radioButton3.Checked)
{
CheckedValue = 0;
NewFilterstr = ColDataName + " =false or " + ColDataName + " is null";
}
else if (radioButton2.Checked)
{
CheckedValue = 1;
NewFilterstr = ColDataName + " =true ";
}
else
{
CheckedValue = 2;
NewFilterstr = string.Empty;
}
Filters = NewFilterstr;
LostFocusExcute(true, Filters);
}
public override void SetFocusEx(string OFilters)
{
if (Filters != OFilters)
{
CheckedValue = 0;
radioButton1.Checked = true;
}
else
{
switch (CheckedValue)
{
case 0:
radioButton3.Checked = true;
break;
case 1:
radioButton2.Checked = true;
break;
default:
radioButton1.Checked = true;
break;
}
}
radioButton1.Focus();
}
}
}