Colored progressbar - c#

I was using a program made in C# and came across these progress bars, one of which is blue.
Here's a picture of the progress bars in question:
The forecolor property obviously doesn't do anything, so does anyone know how to do this?
Thanks

If its a winform application then do the following step
In Program.cs comment out the line
Application.EnableVisualStyles();
In code behind:
ProgressBar1.ForeColor = Color.Blue;
ProgressBar1.Style = ProgressBarStyle.Continuous;

Disabling Visual styles as Habib suggested will work, But if you application relies on visual styles to look nicer, You will have to use a custom progress bar.
Color Progress Bar - CodeProdject
TerrariViewer uses Wpf as I understand, and if your willing to use that, this is a possibility
Progressbar foreground color

Related

Custom textbox style

I've made a custom textbox in Photoshop, and I want to apply it. I know, that you can't change the background in Visual Studio, or make it transparent. I've seen a few methods on how to do it, but they weren't very clear.
So I want to ask you - what is the esiest way to change the background of a textbox or make it transparent?
You need to Add a new user control , say CustomTextBox and Put this inside the constructor, which will make it transparent
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
C# transparency on textbox
Not sure about transparency, but changing the background of a text box is simple, check this link:
XAML:
http://www.c-sharpcorner.com/UploadFile/mahesh/XAMLTextBox04092007062405AM/XAMLTextBox.aspx
Also, if working on WinForms; you have the BackColor property that works in the same way:
http://msdn.microsoft.com/en-us/library/s2kh9x59(v=vs.110).aspx
EDIT:
You can do it by using a richtextbox instead... kind of.
http://www.codeproject.com/Articles/4544/Insert-Plain-Text-and-Images-into-RichTextBox-at-R
http://www.codeproject.com/Articles/12135/Inserting-images-into-a-RichTextBox-control-the-OL

Visual Studio 2010: Progressbar does not change color?

Situation:
I'm working on a new application that starts on opening a timer, when the timer ticks a progressbar loads.
What I want to do:
The basic thing I want is just change the color of the green bar. For example to blue.
My Problem:
I tried to change the color, if I look in the Properties Window of my progressbar, I can change the BackColor and ForeColor. Exactly as I did.
Now, I'm sure I did change the color but the changes doesn't seem to affect the progressbar.
It does not seem to change at all.. It still stays grey and green.
Is it possible to change this?
Maybe I need some code(C# or .NET)? (no need to tell the exact code, some basic pricipe is good)
Thank You
Locate the following line of code within your solution (tipically in Program.cs):
Application.EnableVisualStyles();
Comment out this line. Now the color of the progress bar will change as expected, but the style of your controls will also change a little. I'm curremtly trying to find a better solution for this myself.

Oscillating horizontal green glow whilst something is loading c#

When loading something such as a software update in Windows 7 there is often an oscillating green glow effect in a horizontal bar. Is this a standard control that can be utilized in C#? If not, how can it be incorporated into a C# app.?
This control is called ProgressBar.
If you are using WPF the property IsIndeterminate has to be set to true to have a "running green glow".
You can implemented this using BackgroundWorker to update a progress bar ("the green glowing horizontal bar), and the same time keep the application main thread responsive. See this SO post, or google around BackgroundWorker + Progress bar.

Customizing Windows Forms (table)

I have no clue if this is possible or not as I'm new to C#. But is it possible to make a Windows Forms look like the picture? Where you have a
gradient at top
alternating color rows
change the default text color
change the default highlight color
change the way the scroll bar looks
If so, are there tutorials for these someone can point me to?
Gradient effects will take tedious paint task. You have some example here
Alternating Row Colors,
datagridview1.AlternatingRowsDefaultCellStyle.BackColor= Color.Blue;
Change Text Color
datagridview1.RowsDefaultCellStyle.ForeColor = Color.Red;
Change Highlight Color
`datagridview1.RowsDefaultCellStyle.SelectionBackColor = Color.Pink;
As far as I know scroll-bar will have the look of your current system theme and cant be change that easily unless you write your own code for it.
Regarding skinning (gradients, custom scroll bar): WinForms are a wrapper around Win32 native controls. They were not designed with visual appearance customization in mind. It is possible but will require an awful lot of work: There is nothing comparable to CSS in WinForms.
An arguably easier alternative would be WPF.
Of course, the most straightforward might be to look for a 3rd party component such as Krypton's DataGrid (free).

Loading icon / progress bar

what control can i use to place in my programme so that i can have a loading bar. For example
ProgressBar pb = new ProgressBar();
pb.start();
connectToDatabase();
pb.stop();
Is this possible in c#?
Thanks
Sure. There's a ProgressBar control in the Windows Forms library. Set its Style to Marquee and you should get a scrolling on/off pattern that indicates progress is being made.
A ProgressBar requires your code to periodically update the progress as you work through the task. Also, the progress only has meaning when you can roughly calculate what percent you have completed.
If you just want something moving to show that the program is busy, you can set the progress bar Style property to ProgressBarStyle.Marquee. This style is used to indicate something is happening without reporting the percent the task is complete.
Is there not a simple control called progressbar? Or are you asking something more complex that I'm missing?
Heres a knowledgebase article about created a smooth progressbar
Link to Article.
And heres a tutorial

Categories

Resources