Solved

Flexgrid?

Posted on 2001-09-17
5
178 Views
Last Modified: 2010-05-02
Private Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As Long) As Long

Private Sub Form_Load()
FG.Rows = 1
FG.Row = 0
FG.Col = 0
FG.ColWidth(0) = 1485
FG.Text = "Ejendomsnummer:"
FG.Col = 1
FG.Text = "Klientnummer:"
FG.ColWidth(1) = 1285
FG.Col = 2
FG.Text = "Tilknyttet m?gler:"
FG.ColWidth(2) = 1485
FG.Col = 3
FG.Text = "Afgivet bud:"
FG.ColWidth(3) = 1085
FG.Col = 4
FG.Text = "Sagsstatus:"
FG.ColWidth(4) = 1485
For x = 0 To 4
fgwidth = fgwidth + FG.ColWidth(x)
Next
FG.Width = fgwidth + 8
FG.Col = 0
AddNew 65, 4, "Gert ffgfHansen", "12003400", 9
AddNew 65, 13433, "Gert fgfgHansen", "1234000", 1
'AddNew 56, 5, "Gert gfgffgHansen", "12034000", 3
'AddNew 23, 645, "Geffgfgrt Hansen", "12034000", 4
'AddNew 43, 23, "Gert ffdgHansen", "12340000", 5
'AddNew 23, 53, "Gert ggfdHansen", "12430000", 6
'AddNew 2, 33, "Gert Hagfdgnsen", "12034000", 7
'AddNew 54, 3, "Gert Hafgnsen", "12003400", 10

End Sub

Sub AddNew(Ejendomsnummer As Long, Klientnummer As Long, TilKnyttetM?gler As String, AfgivetBud As String, SagsStatus As Long)
FG.Rows = FG.Rows + 1
FG.Row = FG.Rows - 1
FG.Col = 0
FG.Text = Ejendomsnummer
FG.CellAlignment = 0
FG.Col = 1
FG.Text = Klientnummer
FG.CellAlignment = 0
FG.Col = 2
FG.Text = TilKnyttetM?gler
FG.CellAlignment = 0
FG.Col = 3
FG.Text = AfgivetBud
FG.CellAlignment = 0
Load Bar(Bar.UBound + 1)
Set CurrBar = Bar(Bar.UBound)
CurrBar.Left = FG.ColPos(4)
CurrBar.Height = (FG.RowHeight(1) * FG.Row) - 10
CurrBar.Top = FG.RowHeight(0)
CurrBar.Width = FG.ColWidth(4) - 10
CurrBar.Value = SagsStatus
CurrBar.Visible = True
BringWindowToTop CurrBar.hwnd
Set CurrBar = Nothing
FG.Col = 0
End Sub

I have this code, it is supposed to make a new progressbar for each row, but if i set one progressbarvalue all the values changes....

can anybody help?
0
Comment
Question by:5
  • 3
5 Comments
 
LVL 22

Expert Comment

by:rspahitz
ID: 6488415
Why are you loading a new bar eash time you add an item:

    Load Bar(Bar.UBound + 1)

then throwing it away at the end:

    Set CurrBar = Nothing
???


0
 
LVL 38

Expert Comment

by:PaulHews
ID: 6488430
Looks Ok to me so far.
Where's the code where you change the progbar value?
0
 
LVL 38

Accepted Solution

by:
PaulHews earned 300 total points
ID: 6488450
I think you have mixed up the code to change the CurrBar.Top with the code to change the CurrBar.Height.  You are probably only seeing one wide bar.
0
 

Author Comment

by:5
ID: 6488488
lol..yup..that was it....duh! thank you :)
0
 
LVL 38

Expert Comment

by:PaulHews
ID: 6488496
Sometimes the simplest mistakes are the hardest to spot.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

766 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question