Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check Box in DataGrid
Message
From
04/11/1999 18:37:50
 
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00279768
Message ID:
00287248
Views:
25
Oh, thanks so much.
I will try this today in office. and reply to you ASAP at home. (I can't go to internet in office, what a great computer department of a bank)
>>Hello, This is also my problem I face now.
>>But I have no money to buy from third party, can I write it by myself?
>>I have read the VB6 online help, here is the ButtonClick Event (DataGrid Control) last paragraph:
>>Typically, you enable the column button when you want to drop down a Visual Basic control (such as the built-in combo box, a bound list box, or even another DataGrid 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.
>
>I found this code last week but I didn't have the chance to try it. If you try it, please be gentleman and comment it here!
>
>How do i correctly allign the listbox to show a dropdown in the dbgrid (ButtonClick event)? It is possible to do show it using the Rowheight property but alligning it presicely is a problem. Any suggestions?
>
>===============================
>
>This example uses a list box, but you can replace the name of the list control with a combobox to achieve the same result :
>
>Replace grdCensus with your grid control name.
>
>First in the click command of the list/combo control :
>
>Private Sub DBList1_Click()
>
>grdCensus.Col = 2 'replace with the column you need
>grdCensus.Text = DBList1.Text
>grdCensus.SetFocus
>grdCensus.Col = 3 'the next col you want to have focus
>DBList1.Visible = False
>
>End Sub
>
>In the RowColChange event of your grid :
>
>With grdCensus
>'in the code below replace 2 with your column #
> If .Col = 2 And .Text = "" Then
> DBList1.Left = .Left + .Columns(2).Left
> DBList1.Top = .Top + (.Row * .RowHeight) + SSTab1.Top
>'the line below makes sure the list isn't being shown off
>'the bottom of the screen. You'll need to adjust the value
>'3600 as needed depending on your forms size and position
> If DBList1.Top > 3600 Then DBList1.Top = 3600
> DBList1.ZOrder 0
> DBList1.Visible = True
> DBList1.SetFocus
> Else
> DBList1.Visible = False
> End If
>end with
oh, what is the fastest way to write good program?
Previous
Reply
Map
View

Click here to load this message in the networking platform