English 中文(简体)
灵活电网非校正栏
原标题:Flex grid non editable column
  • 时间:2012-01-15 04:47:04
  •  标签:
  • vb6

我不想把一些一栏放在非常法。

Flex Grid

column1, column2, .... column35

i 只想从第1栏......第10栏中删除,而其余一栏则不需要编辑或打字。

如何做。

问题回答

我认为,MSlex Grid的设计是为了显示数据而不是编辑。 如果你需要编辑细胞数据,那么你可以采用“灵活电梯”方法,在运行时间推展一个文本箱,以记录用户数据输入,并在代码中确定该单元的“Text”财产。 否则,你可以选择使用不同的控制手段。

下面是上述做法的一些例子:

http://support.microsoft.com/kb/2413<55/a>

rel=“nofollow” http://www.vb-helper.com/howto_edit_flexgrid_control.html

我在VB6中将特别用户控制在电离层。 如果你想要,我可以寄送一份副本。

法典一用于洗ed囚室:

Private Sub fg_KeyDown(KeyCode As Integer, Shift As Integer)
    Dim Cancel As Boolean
    Dim Idc As Long
    Dim x

    If KeyCode = vbKeyEscape And Shift = 0 Then
        If Not fgLocked Then
            If fgRowChanged Then
                RaiseEvent BeforeRestoreBuffer
                For Idc = 1 To UBound(fgBuffer)
                    x = fgBuffer(Idc)
                    fgValues(Idc, fg.Row) = x
                    If fgColFormat(Idc) = "*" And fgBuffer(Idc) <> "" Then
                        fg.TextMatrix(fg.Row, Idc) = "*******"
                    ElseIf fgColFormat(Idc) = "RTF" Then
                        fg.TextMatrix(fg.Row, Idc) = Format(fgBuffer(Idc), "")
                    Else
                        fg.TextMatrix(fg.Row, Idc) = Format(fgBuffer(Idc), fgColFormat(Idc))
                    End If
                Next
                fgRowChanged = False
                RaiseEvent RestoreBuffer
            End If
        End If
    ElseIf KeyCode = vbKeyReturn And Shift = 0 Then
        NextCell
    ElseIf KeyCode = vbKeyF2 And Shift = 0 Then
        If Not fgLocked Then
            If fgColFormat(fg.Col) = "RTF" Then
                CellEditBig fgValues(fg.Col, fg.Row)
            Else
                CellEdit fgValues(fg.Col, fg.Row)
            End If
        End If
    ElseIf KeyCode = vbKeyF2 And Shift = vbShiftMask Then
        If Not fgLocked Then
            CellEditBig fgValues(fg.Col, fg.Row)
        End If
    ElseIf KeyCode = vbKeyDelete And Shift = 0 Then
        If Not fgLocked Then
            RaiseEvent BeforeDelete(Cancel)
            If Not Cancel Then
                If fg.Rows = fg.FixedRows + 1 Then
                    fg.AddItem ""
                    If fgRowNumber Then fg.TextMatrix(fg.Rows - 1, 0) = fg.Rows - 1
                    fgValues_AddItem ""
                End If
                fg.RemoveItem fg.Row
                If fgRowNumber Then Renumera
                fgValues_RemoveItem fg.Row
                LoadBuffer fg.Row
                RaiseEvent AfterDelete
            End If
        End If
    ElseIf KeyCode = vbKeyInsert And Shift = 0 Then
        If Not fgLocked Then
            RaiseEvent BeforeInsert(Cancel)
            If Not Cancel Then
                fg.AddItem "", fg.Row
                If fgRowNumber Then Renumera
                fgValues_AddItem "", fg.Row
                RaiseEvent AfterInsert
            End If
        End If
    Else
        RaiseEvent KeyDown(KeyCode, Shift)
    End If
End Sub




相关问题
Prevent windows from queuing shellexecute requests

Win.ShellExecute 0, "open", "C:dirprogram.exe", "arguments", vbNullString, SW_SHOWNORMAL Win.ShellExecute 0, "open", "http://www.google.com", vbNullString, vbNullString, SW_SHOWNORMAL I want google....

Why is My Loop Only Deleting One File?

Using VB6 In a folder, i have n number of files, i want to delete a 0 kb files code Dim filename5 As String filename5 = Dir$(txtsourcedatabasefile & "*_*", vbDirectory) MsgBox filename5 Do ...

How to check the filesize?

Using VB6 I have the text file with different sizes, so i want to delete the file where filesize = 0 kb. How to make a vb6 code for deleting the 0 kb files. Need vb6 code Help

File Rename problem?

I m using VB6 and I have a folder where I have n number of files. I want to change the file extension to .txt. I used the code below to change the extension of all .fin files to .txt. Dim filename1 ...

Error 20728-F while in using Crystal Reports in VB6

I m using Crystal Reports in my VB6 project, but I m facing error while loading the report in crystalreport1.action=1; Please give me some solution for this problem. It is showing the error as Error ...

DllRegisterServer entry point was not found

When running my vb6 application I am getting error like, runtime error 53 : file not found: rscomclNoMsg.dll then i tried to register that dll from cmd line using regsvr32. Then I am getting ...

SQL Server 2000, ADO 2.8, VB6

How to determine if a Transaction is active i.e. before issuing Begin Transaction I want to ensure that no previous transaction are open.. the platform is VB6, MS-SQL Server 2000 and ADO 2.8

热门标签