Click here to Skip to main content
15,908,444 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Datagridview checkbox enter key Pin
Dr.Walt Fair, PE25-May-10 15:41
professionalDr.Walt Fair, PE25-May-10 15:41 
GeneralRe: Datagridview checkbox enter key Pin
C#Coudou25-May-10 15:56
C#Coudou25-May-10 15:56 
GeneralRe: Datagridview checkbox enter key Pin
Dr.Walt Fair, PE25-May-10 16:47
professionalDr.Walt Fair, PE25-May-10 16:47 
GeneralRe: Datagridview checkbox enter key [modified] Pin
C#Coudou25-May-10 18:35
C#Coudou25-May-10 18:35 
GeneralRe: Datagridview checkbox enter key Pin
Luc Pattyn25-May-10 18:59
sitebuilderLuc Pattyn25-May-10 18:59 
GeneralRe: Datagridview checkbox enter key Pin
C#Coudou25-May-10 20:33
C#Coudou25-May-10 20:33 
GeneralRe: Datagridview checkbox enter key Pin
Dr.Walt Fair, PE26-May-10 4:51
professionalDr.Walt Fair, PE26-May-10 4:51 
QuestionMSFlexGrid with Arrays Pin
Shane.R.G25-May-10 14:36
Shane.R.G25-May-10 14:36 
The problem is I have two sides to my program one where general users can access my MSFlexGrids, three in total which are all stored and separate text files; and on the other side of the program I am updating the flexgrids which then save to files, which all works fine as shown below now what I’m looking to do now is to update one flexgrid such as my race one which contains details such as drivers name, team and positions for races such as 1st, 2nd, 3rd, then when this updates it also uses the positions to convert it into point values 10 and descending then have it write to other flexgrid/s for that particular driver now I no I need to use arrays I’m considering dynamic for expansion later on and I have been through it in my head and seems simple to explain but I’m having trouble even knowing where to start implementing this part so any help would be appreciated. If any more details are needed please ask. Thanks in advance.

Private Sub FillGridFromFile()
'code that reads from text file
Dim lRow As Long
Dim lCol As Long
Dim lFile As Long
Dim sFilepath As String
Dim sline As String
Dim vData As Variant
Dim strExist As String

MSFlexGrid1.FixedCols = 0
MSFlexGrid1.FixedRows = 0

 strExist = Dir("Drivers.txt")

lFile = FreeFile

Open strExist For Input As #lFile
lRow = 0

Do While Not EOF(lFile)
Line Input #lFile, sline

If Not Len(Trim(sline)) = 0 Then

lRow = lRow + 1

vData = Split(sline, ",")

MSFlexGrid1.Rows = lRow
If (UBound(vData) + 1) > MSFlexGrid1.Cols Then

MSFlexGrid1.Cols = UBound(vData) + 1
End If

For lCol = 0 To UBound(vData)

MSFlexGrid1.TextMatrix(lRow - 1, lCol) = Trim(vData(lCol))
Next lCol
End If
Loop

Close #lFile

End Sub 


Private Sub cmdUpDri_Click()
'code that write back to text file
  Dim strExist As String


If MSFlexGrid1 = "" Then
MsgBox "One or More Cells Are Empty" & vbNewLine & "Please Ensure All Data Is Correct Before Saving!" & vbNewLine & "Please Set Default to Zero, If There is no Data to Enter", vbExclamation, "Empty Cells"
frmUpdate.SetFocus
Exit Sub
End If

Dim MyFreeFile As Integer

Dim reply As Integer

    reply = MsgBox("Do you really wish to Update Drivers League?", vbYesNo + vbExclamation, "Confirm Update")
        If reply = vbYes Then
            MsgBox "Drivers League Update Completed Sucssefully!", vbInformation, "Update Complete"
           
        
    Dim icol As Integer
    Dim irow As Integer
    Dim MyString As String
  
    
    strExist = Dir("Drivers.txt")
    MyFreeFile = FreeFile
    Open strExist For Output As MyFreeFile
    For irow = 0 To MSFlexGrid1.Rows - 1
        For icol = 0 To MSFlexGrid1.Cols - 1
           MyString = MyString & MSFlexGrid1.TextMatrix(irow, icol) & _
              IIf((icol = MSFlexGrid1.Cols - 1), "", ",")
       Next
       Print #MyFreeFile, MyString
       MyString = ""
   Next
  
   Close MyFreeFile
   
   Else
        If reply = vbNo Then
        frmUpdate.SetFocus
        End If
        End If
   
End Sub 

Questionconection with postgre Pin
mabrahao25-May-10 10:33
mabrahao25-May-10 10:33 
AnswerRe: conection with postgre Pin
Luc Pattyn25-May-10 10:46
sitebuilderLuc Pattyn25-May-10 10:46 
QuestionScrolling a text box Pin
Pasan14825-May-10 8:04
Pasan14825-May-10 8:04 
AnswerRe: Scrolling a text box Pin
Luc Pattyn25-May-10 8:44
sitebuilderLuc Pattyn25-May-10 8:44 
JokeRe: Scrolling a text box Pin
William Winner25-May-10 9:27
William Winner25-May-10 9:27 
GeneralRe: Scrolling a text box Pin
DaveAuld25-May-10 9:34
professionalDaveAuld25-May-10 9:34 
GeneralRe: Scrolling a text box Pin
William Winner25-May-10 9:43
William Winner25-May-10 9:43 
GeneralRe: Scrolling a text box Pin
Dr.Walt Fair, PE25-May-10 9:36
professionalDr.Walt Fair, PE25-May-10 9:36 
GeneralRe: Scrolling a text box Pin
Luc Pattyn25-May-10 9:42
sitebuilderLuc Pattyn25-May-10 9:42 
AnswerRe: Scrolling a text box Pin
William Winner25-May-10 9:29
William Winner25-May-10 9:29 
Question[VB.NET] TextBox's Multiple text into ListView items and subitems Pin
Dimz9325-May-10 4:38
Dimz9325-May-10 4:38 
AnswerRe: [VB.NET] TextBox's Multiple text into ListView items and subitems Pin
DaveAuld25-May-10 5:23
professionalDaveAuld25-May-10 5:23 
AnswerRe: [VB.NET] TextBox's Multiple text into ListView items and subitems Pin
William Winner25-May-10 6:33
William Winner25-May-10 6:33 
GeneralRe: [VB.NET] TextBox's Multiple text into ListView items and subitems Pin
Luc Pattyn25-May-10 7:06
sitebuilderLuc Pattyn25-May-10 7:06 
QuestionHelp with Save File problem Pin
normschaef25-May-10 4:31
normschaef25-May-10 4:31 
AnswerRe: Help with Save File problem Pin
DaveAuld25-May-10 5:27
professionalDaveAuld25-May-10 5:27 
AnswerRe: Help with Save File problem Pin
normschaef25-May-10 5:49
normschaef25-May-10 5:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.