Click here to Skip to main content
15,915,869 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionReading configurations from a Visual Studio Add-in [modified] Pin
BigBenDk18-Oct-07 11:08
BigBenDk18-Oct-07 11:08 
QuestionReferencing components with index Pin
sysrev18-Oct-07 5:04
sysrev18-Oct-07 5:04 
AnswerRe: Referencing components with index Pin
led mike18-Oct-07 5:29
led mike18-Oct-07 5:29 
GeneralRe: Referencing components with index Pin
sysrev18-Oct-07 5:32
sysrev18-Oct-07 5:32 
AnswerRe: Referencing components with index Pin
Robert Rohde18-Oct-07 13:34
Robert Rohde18-Oct-07 13:34 
GeneralRe: Referencing components with index Pin
sysrev19-Oct-07 0:00
sysrev19-Oct-07 0:00 
GeneralRe: Referencing components with index Pin
Robert Rohde19-Oct-07 3:18
Robert Rohde19-Oct-07 3:18 
GeneralRe: Referencing components with index Pin
sysrev19-Oct-07 4:22
sysrev19-Oct-07 4:22 
I think I can see what you are suggesting and am trying to experiment with it in a new application as here:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace IndexComponents
{
public partial class Form1 : Form
{
private ProgressBar pb1;
private ProgressBar pb2;
private ProgressBar pb3;
private List<ProgressBar> _bars;
public Form1()
{
InitializeComponent();
int[] someArrayWithTheValues = new int[3] { 1, 2, 3 };
//Field declaration in the Form/UserCotrol
/// private List _bars;
//somewhere after the InitializeComponents call
/// _bars = new List(new ProgressBar[] { pb1, pb2, pb3 });//when you want to update the bars
_bars = new List<ProgressBar>(new ProgressBar[] { pb1, pb2, pb3 });//when you want to update the bars
for (int i = 0; i < 3; i++)
{
_bars[i] = someArrayWithTheValues[i];
}
//With the mod operator you could also easily switch which hour should be displayed at the top:
int hourToDisplayAtTop = 2;

for (int i = 0; i < 3; i++)
{
_bars[i] = someArrayWithTheValues[(i + hourToDisplayAtTop) % 24];
}
}
}
}

I am now working on the last two(I hope!) build error which are flagged within the two for loops as below:
Error 1 Cannot convert type 'int' to 'System.Windows.Forms.ProgressBar'
Error 2 Cannot implicitly convert type 'int' to 'System.Windows.Forms.ProgressBar'

Ted Edwards
GeneralRe: Referencing components with index Pin
Robert Rohde19-Oct-07 6:05
Robert Rohde19-Oct-07 6:05 
GeneralRe: Referencing components with index Pin
sysrev20-Oct-07 0:52
sysrev20-Oct-07 0:52 
QuestionHow to check of folder is public? Pin
Vitaly Tomilov18-Oct-07 1:19
Vitaly Tomilov18-Oct-07 1:19 
AnswerRe: How to check of folder is public? Pin
Robert Rohde18-Oct-07 13:42
Robert Rohde18-Oct-07 13:42 
AnswerRe: How to check of folder is public? Pin
Jonathan [Darka]19-Oct-07 7:30
professionalJonathan [Darka]19-Oct-07 7:30 
QuestionUnable to cast COM object of type System.__ComObject to class type mshtml.HTMLDocumentClass Pin
MyAmanda17-Oct-07 22:39
MyAmanda17-Oct-07 22:39 
AnswerRe: Unable to cast COM object of type System.__ComObject to class type mshtml.HTMLDocumentClass Pin
vimalsharma@yahoo.com10-May-09 15:07
vimalsharma@yahoo.com10-May-09 15:07 
QuestionException Line Number at runtime Pin
Michael Sterk17-Oct-07 19:44
Michael Sterk17-Oct-07 19:44 
AnswerRe: Exception Line Number at runtime Pin
DavidNohejl17-Oct-07 23:19
DavidNohejl17-Oct-07 23:19 
GeneralRe: Exception Line Number at runtime Pin
Michael Sterk17-Oct-07 23:22
Michael Sterk17-Oct-07 23:22 
GeneralRe: Exception Line Number at runtime Pin
lmoelleb17-Oct-07 23:36
lmoelleb17-Oct-07 23:36 
QuestionCould not find the text file in window service Pin
sabby200617-Oct-07 18:28
sabby200617-Oct-07 18:28 
AnswerRe: Could not find the text file in window service Pin
il_masacratore17-Oct-07 22:37
il_masacratore17-Oct-07 22:37 
GeneralRe: Could not find the text file in window service Pin
sabby200617-Oct-07 23:09
sabby200617-Oct-07 23:09 
Questionintercepting network traffic of a process Pin
prattel17-Oct-07 13:59
prattel17-Oct-07 13:59 
AnswerRe: intercepting network traffic of a process Pin
Dave Kreskowiak17-Oct-07 14:09
mveDave Kreskowiak17-Oct-07 14:09 
GeneralRe: intercepting network traffic of a process Pin
prattel17-Oct-07 14:21
prattel17-Oct-07 14:21 

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.