how to scroll the text from bottom to top
-
The following code reads data from excel and displays it in the listview...I want the data displayed in the listview to scroll / move from bottom to top automatically !!!!!.......... hw can i do it ????.....Plz help !!! ************************************************************************************** using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Excel; namespace WindowsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { string Path = @"c:\gg.xls"; Excel.ApplicationClass app = new ApplicationClass(); Excel.Workbook workBook = app.Workbooks.Open(Path, 0, true, 5, Type.Missing, Type.Missing, true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true); Excel.Worksheet workSheet = (Excel.Worksheet)workBook.ActiveSheet; int index = 0; object rowIndex = 2; object colIndex1 = 1; object colIndex2 = 2; try { while (((Excel.Range)workSheet.Cells[rowIndex, colIndex1]).Value2 != null) { rowIndex = 2 + index; string firstName = ((Excel.Range)workSheet.Cells[rowIndex, colIndex1]).Value2.ToString(); string lastName = ((Excel.Range)workSheet.Cells[rowIndex, colIndex2]).Value2.ToString(); listView1.Items.Add(firstName); //listView1.Items.Add("\n"); listView1.Items.Add(lastName); index++; } } catch (Exception ex) { app.Quit(); } } } } ************************************************************************************
-
The following code reads data from excel and displays it in the listview...I want the data displayed in the listview to scroll / move from bottom to top automatically !!!!!.......... hw can i do it ????.....Plz help !!! ************************************************************************************** using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Excel; namespace WindowsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { string Path = @"c:\gg.xls"; Excel.ApplicationClass app = new ApplicationClass(); Excel.Workbook workBook = app.Workbooks.Open(Path, 0, true, 5, Type.Missing, Type.Missing, true, Excel.XlPlatform.xlWindows, "\t", false, false, 0, true); Excel.Worksheet workSheet = (Excel.Worksheet)workBook.ActiveSheet; int index = 0; object rowIndex = 2; object colIndex1 = 1; object colIndex2 = 2; try { while (((Excel.Range)workSheet.Cells[rowIndex, colIndex1]).Value2 != null) { rowIndex = 2 + index; string firstName = ((Excel.Range)workSheet.Cells[rowIndex, colIndex1]).Value2.ToString(); string lastName = ((Excel.Range)workSheet.Cells[rowIndex, colIndex2]).Value2.ToString(); listView1.Items.Add(firstName); //listView1.Items.Add("\n"); listView1.Items.Add(lastName); index++; } } catch (Exception ex) { app.Quit(); } } } } ************************************************************************************
mist_psycho wrote:
I want the data displayed in the listview to scroll / move from bottom to top automatically !!!!!
So you want to fill the listview in reverse order, making the last read item the top-item in the listview? Or do you just want to scroll to the top when the loading is done?
I are troll :)
-
mist_psycho wrote:
I want the data displayed in the listview to scroll / move from bottom to top automatically !!!!!
So you want to fill the listview in reverse order, making the last read item the top-item in the listview? Or do you just want to scroll to the top when the loading is done?
I are troll :)
i want it to scroll continously from bottom to top when d form is being loaded !!!
-
i want it to scroll continously from bottom to top when d form is being loaded !!!
If I understood correctly now, you want to load a record, add it to the bottom of the list, and scroll up? Load your list in the reverse order as now, inserting items at the top of the listview instead of the bottom :) That might slow down loading though, since it will wait for a repaint before loading the next one.
I are troll :)
-
If I understood correctly now, you want to load a record, add it to the bottom of the list, and scroll up? Load your list in the reverse order as now, inserting items at the top of the listview instead of the bottom :) That might slow down loading though, since it will wait for a repaint before loading the next one.
I are troll :)
ohhkk.... Wat if i display d values in d form of labels. Then can i scroll / move the labels from bottom to top continously !!!
-
ohhkk.... Wat if i display d values in d form of labels. Then can i scroll / move the labels from bottom to top continously !!!