HPC.ru lite - Все форумы
Форум: Программирование для КПК
Тема: Grid Control (GridCtrl) подключение eVB 3.0
[Ответить]
Mutronics [14.05.2006 00:40] Grid Control (GridCtrl) подключение eVB 3.0:
Никак в eVB 3.0 немогу подключить Grid к своему проекту, Listbox без проблем, Grid никак, вот код:
Option Explicit
Public CN As ADOCE.Connection
Public RS As ADOCE.Recordset
Private Sub Command1_Click()
If Text2.Text = "" Then
MsgBox ("На это я пойтить немогу!")
Else
If Len(Text2.Text) < 3 Then
MsgBox ("Необходимо ввести 3 и более символов!")
Else
Dim n As Integer
List1.Clear
List2.Clear
List3.Clear
List1.Refresh
Text1.Text = ""
Text3.Text = ""
Set CN = CreateObject("ADOCE.Connection.3.0")
CN.ConnectionString = "data source = \My Documents\base.cdb"
CN.Open
Set RS = CreateObject("ADOCE.Recordset.3.0")
If Option1.Value = True Then
RS.Open "SELECT phone,fio,adres FROM base WHERE phone LIKE '%" & Text2.Text & "%' ORDER BY fio DESC", CN, adOpenForwardOnly, adLockOptimistic
End If
If Option2.Value = True Then
RS.Open "SELECT phone,fio,adres FROM base WHERE fio LIKE '%" & Text2.Text & "%' ORDER BY fio DESC", CN, adOpenForwardOnly, adLockOptimistic
End If
If Option3.Value = True Then
RS.Open "SELECT phone,fio,adres FROM base WHERE adres LIKE '%" & Text2.Text & "%' ORDER BY fio", CN, adOpenForwardOnly, adLockOptimistic
End If
'Вот тут цикл пробега по базе
Do While Not RS.EOF
n = n + 1
List1.AddItem RS("fio")
List2.AddItem RS("phone")
List3.AddItem RS("adres")
' вот тут проблема
GridCtrl1 ???????
Loop
If n = 0 Then
MsgBox ("Ничего не найдено!")
Else
List1.ListIndex = 0
Text1.Text = List2.List(List1.ListIndex)
Text3.Text = List3.List(List1.ListIndex)
End If
RS.Close
CN.Close
Set CN = Nothing
End If
End If
Text2.SetFocus
End Sub
Private Sub Command2_Click()
Text2.Text = ""
Text2.SetFocus
End Sub
Private Sub Form_Load()
Dim mnuFile As MenuBarLib.MenuBarMenu
Set mnuFile = MenuBar1.Controls.AddMenu("Файл", "mnuFile")
mnuFile.Items.Add 1, "mnuFileExit", "Выход"
End Sub
Private Sub Form_OKClick()
App.End
End Sub
Private Sub List1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Text1.Text = List2.List(List1.ListIndex)
Text3.Text = List3.List(List1.ListIndex)
Text2.SetFocus
End Sub
Private Sub MenuBar1_MenuClick(ByVal Item As MenuBarLib.Item)
Select Case Item.Key
Case "mnuFileExit"
App.End
End Select
End Sub
Private Sub Text2_Change()
End Sub
Private Sub Text3_Change()
End Sub
Помогите плиз !!!
[Ответить]