C# - How to change value of a progress bar in a secondary thread
Tag : chash , By : user87225
Date : March 29 2020, 07:55 AM
should help you out In my program I import millions of records to a SQL Server database with the help of SqlBulkCopy class. Since this is a heavy lifting it takes quite some time. While the process goes on I want to show the progress in a progressbar control. To be notified for the rows copied I've done this: , You can have one extension class, like public static class ControlExtensions
{
public static void Invoke(this Control control, Action action)
{
if (control.InvokeRequired) control.Invoke(new MethodInvoker(action), null);
else action.Invoke();
}
}
progressBar.Invoke(() => { progressBar.PerformStep(); };
|
Get onscreen position of current seekbar progress/secondary progress?
Date : March 29 2020, 07:55 AM
Hope that helps I got around this by setting the max progress to the width of the screen: WindowManager wm = (WindowManager) myAppContext.getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
Point size = new Point();
try{
display.getSize(size);//only works on later versions of android
}
catch (Exception e) {
int width = display.getWidth(); // deprecated
int height = display.getHeight(); // deprecated
size = new Point(width, height);
}
myProgressBar.setMax(size.x);
|
Progress view with secondary progress for objective C (three colored progress bar)
Tag : ios , By : Helpful Dude
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further he solution I came up with is fairly simple, and works beautifully for my needs. I would simply make three labels, with different colors i need, and set their width accordingly. Also, by doing this, I was able to set progress bar height to as much I want. //question size represents width of one question on progress bar. You just divide the width of the entire bar with number of possible questions (max)
int questionSize = 280 / num_possible_question;
int greenProgressSize = green * questionSize;
CGRect greenProgress = CGRectMake( 20, 95, greenProgressSize, 8 );
cell.greenLabel.frame = greenProgress;
int redProgressSize = (red+green) * questionSize;
CGRect redProgress = CGRectMake( 20, 95, redProgressSize, 8 );
cell.redLabel.frame = redProgress;
CGRect grayProgress = CGRectMake( 20, 95, 280, 8 );
cell.grayLabel.frame = grayProgress;
|
WinRT Slider draw secondary progress on top of primary progress?
Date : March 29 2020, 07:55 AM
wish helps you I want to build custom slider with secondary progress on top of the primary progress chosen by the customer. , Like this: <Grid VerticalAlignment="Top">
<ProgressBar Height="2" MinHeight="2"
Margin="0,-6,0,0" VerticalAlignment="Center"
Foreground="Silver" IsHitTestVisible="False"
Value="65" />
<Slider Background="Transparent" Value="35" />
</Grid>
|
Changing Android SeekBar to draw secondary progress on top of primary progress?
Date : March 29 2020, 07:55 AM
|