|
-
Jan 26th, 2000, 02:41 AM
#1
Thread Starter
Hyperactive Member
Can't anyone help me?
How do I use the DBGrid's button property? The help that I have just says:
Typically, you enable the column button when you want to drop down a control (such as the built-in combo box, a bound list box, or even another DBGrid control) for editing or data entry. When the button in the current cell is clicked, the ButtonClick event will be fired. You can then write code to drop down the desired control from the cell.
It doesn't give me an example or anything else on how to do this. Can someone help with this?
-
Jan 26th, 2000, 03:05 AM
#2
Add an Invisible Listbox to the Form with some List Items in it and set the Appearance to Flat..
Code:
Private Sub DBGrid1_ButtonClick(ByVal ColIndex As Integer)
With DBGrid1.Columns(ColIndex)
List1.Move DBGrid1.Left + .Left + 20, DBGrid1.Top + .Top + ((DBGrid1.Row + 1) * DBGrid1.RowHeight) + 230, .Width
List1.Visible = True
List1.SetFocus
End With
End Sub
Private Sub List1_Click()
DBGrid1.Text = List1
List1.Visible = False
End Sub
Private Sub List1_LostFocus()
List1.Visible = False
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Jan 26th, 2000, 03:20 AM
#3
Thread Starter
Hyperactive Member
Thanks Aaron. That did the trick. It works the same way to use combo boxes? What would be the best way to use a check box? The same way?
-
Jan 26th, 2000, 03:27 AM
#4
Sure, you just have to position the Control over the Selected Cell and make sure any selection is transferred back to the cell value.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Jan 26th, 2000, 03:30 AM
#5
Thread Starter
Hyperactive Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|