Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 4.0 aka C# 2010 > BOOK: Beginning Visual C# 2010
|
BOOK: Beginning Visual C# 2010
This is the forum to discuss the Wrox book Beginning Visual C# 2010 by Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, ; ISBN: 9780470502266
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 2010 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 June 10th, 2012, 10:35 AM
Authorized User
 
Join Date: Nov 2011
Posts: 34
Thanks: 14
Thanked 0 Times in 0 Posts
Default Progress bar in C# windows application

Hello,

i have batch file (142 lines total) syntax is similar to this:


copy something somewhere

start /min excel.xls
start /min excel1.xls
start /min excel2.xls
start /min excel2.xls

-----------------------

and so on

I have created c# Windows form with button which runs batch-all that's fine.However,i want to implement progress bar,which will read thru the bat file once to get the total number of commands in the bat file.
Set the progress bar max value to this value.
Re-read thru the batch file, and after every command is complete, increment the progress bar value by 1


I found Visual Basic code for this,but i would like C# code either.

Thanks in advance.
 
Old June 26th, 2012, 09:40 PM
Authorized User
 
Join Date: Jan 2011
Posts: 41
Thanks: 0
Thanked 1 Time in 1 Post
Default

Provide us with the VB code and we can probably interpret to C# for you.

Cheers!
 
Old June 27th, 2012, 09:36 AM
Authorized User
 
Join Date: Nov 2011
Posts: 34
Thanks: 14
Thanked 0 Times in 0 Posts
Default Sollved

Thanks,but there is no need for that,simply i have converted all dos command
to c# equivalent and all works fine now.
 
Old June 28th, 2012, 03:18 AM
Authorized User
 
Join Date: Nov 2011
Posts: 34
Thanks: 14
Thanked 0 Times in 0 Posts
Default Not solved entirely

Hello,me again,

I have a bunch of excel files with macros,which executes on file open.Macro
connect to the database,refresh itselfs,save results to other workbook and close workbook,another workbook opens,do the same job,closes itself and so on.

c# code for this is:


Code:
  Excel.Application excelApp121 = new Excel.Application();
            excelApp121.Visible = true;
            Excel.Workbooks oBooks121 = excelApp121.Workbooks;
            Excel._Workbook oBook121 = null;
            oBook121 = oBooks121.Open(@"C:\@IT\Izvestaji\Uzice visual\TOP_50_OBST42.xls", oMissing, oMissing,
                oMissing, oMissing, oMissing, oMissing, oMissing, oMissing,
                oMissing, oMissing, oMissing, oMissing, oMissing, oMissing);


            //Run the macros
            RunMacro(excelApp121, new Object[] { "auto_open" });


            // Quit Excel and clean up.

            oBook121.Close(false, oMissing, oMissing);
            System.Runtime.InteropServices.Marshal.ReleaseComObject(oBook121);
            oBook121 = null;
            System.Runtime.InteropServices.Marshal.ReleaseComObject(oBooks121);
            oBooks121 = null;
            excelApp121.Quit();
            System.Runtime.InteropServices.Marshal.ReleaseComObject(excelApp121);
            excelApp121 = null;
All works as expected,BUT (Always there is some "but" is possible to integrate
excel files into windows form application,not as separate excel application window.After some googling i found out that this is achieved using webbrowser control,using this control i can open excel file in application but macro wont run,is possile to run macro in webbrowsercontrol and to close it ?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Progress Bar Will BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 4 May 17th, 2010 02:55 PM
Progress Bar jmss66 VB How-To 6 December 16th, 2009 10:25 PM
Progress Bar toekneel Crystal Reports 0 October 19th, 2004 11:04 AM
Progress Bar kevind23 Classic ASP Basics 1 May 24th, 2004 08:00 AM
Progress Bar BSkelding ASP.NET 1.0 and 1.1 Basics 3 May 4th, 2004 04:12 AM





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