Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 10th, 2005, 03:06 AM
Registered User
 
Join Date: Dec 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default MSFlexGrid

I no have idea how to reduce the coding by controlling the MSFlexGrid. The following is my coding.

Public Sub ResultToGrid(Flex As MSFlexGrid)
Select Case mux_count
'******************************* Unit 1 - 10 ***********************************
Case 0
'Channel 0
'Temperature 25C
With Flex
.Row = 2
.Col = 2
.Text = frmMain.lst25C.List(0)
.Col = 3
.Text = frmMain.lst25C1080.List(0)
.Col = 4
.Text = frmMain.lst25C790.List(0)
.Col = 5
.Text = frmMain.lst25C500.List(0)
'Temperature 70C
.Row = 2
.Col = 6
.Text = frmMain.lst70C.List(0)
.Col = 7
.Text = frmMain.lst70C1080.List(0)
.Col = 8
.Text = frmMain.lst70C500.List(0)
'Temperature -10C
.Row = 2
.Col = 9
.Text = frmMain.lst10C.List(0)
.Col = 10
.Text = frmMain.lst10C1080.List(0)
.Col = 11
.Text = frmMain.lst10C500.List(0)
End With
Case 1
'Channel 1
'Temperature 25C
With Flex
.Row = 3
.Col = 2
.Text = frmMain.lst25C.List(1)
.Col = 3
.Text = frmMain.lst25C1080.List(1)
.Col = 4
.Text = frmMain.lst25C790.List(1)
.Col = 5
.Text = frmMain.lst25C500.List(1)
'Temperature 70C
.Col = 6
.Text = frmMain.lst70C.List(1)
.Col = 7
.Text = frmMain.lst70C1080.List(1)
.Col = 8
.Text = frmMain.lst70C500.List(1)
'Temperature -10C
.Col = 9
.Text = frmMain.lst10C.List(1)
.Col = 10
.Text = frmMain.lst10C1080.List(1)
.Col = 11
.Text = frmMain.lst10C500.List(1)
End With
End Select
End Sub

Basically my mux_count is up to 80, I dun want use this code to control the MSFlexGrid, so any1 knw hw to reduce the code? Thanks......

 
Old January 18th, 2005, 11:45 AM
Registered User
 
Join Date: Jan 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try the following code:

numChannels = 80 ' use the number you need

with flex
for n = 0 to numChannels
  .row = n + 2
  .Col = 2
  .Text = frmMain.lst25C.List(n)
  .Col = 3
  .Text = frmMain.lst25C1080.List(n)
  ' add remaining cols
next n
end with

Jose C Danino





Similar Threads
Thread Thread Starter Forum Replies Last Post
MSFlexGrid in VC++ arun.sharma.kumar Visual C++ 0 March 24th, 2007 02:27 AM
Msflexgrid with Textbox Rudner Pro VB 6 2 November 26th, 2004 05:57 AM
Problems with MSFlexgrid amerk20 Access VBA 2 March 23rd, 2004 03:35 PM
MsFlexGrid vs. DataGrid - which ? mike123abc SQL Server 2000 3 November 19th, 2003 11:19 PM
MSFlexGrid meireliezer Visual C++ 0 November 19th, 2003 07:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.