Skip to content

Instantly share code, notes, and snippets.

View mkrausG's full-sized avatar
🏠
Working from home

Marcus Kraus mkrausG

🏠
Working from home
  • Berlin, Germany
View GitHub Profile
@mkrausG
mkrausG / Program.cs
Created February 1, 2023 16:51 — forked from DanielSWolf/Program.cs
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
using System;
using System.Threading;
static class Program {
static void Main() {
Console.Write("Performing some task... ");
using (var progress = new ProgressBar()) {
for (int i = 0; i <= 100; i++) {
progress.Report((double) i / 100);
@mkrausG
mkrausG / DevExpressListboxControlPermitIndexChange.cs
Last active June 18, 2019 17:35
DevExpress ListboxControl Undo Select new Item if validation or so fails
int currentIndex = -1;
private void listBoxControl1_SelectedIndexChanged(object sender, EventArgs e)
{
if ( listBoxControl1.SelectedIndex == currentIndex )
return;
if ( currentIndex == -1 && listBoxControl1.SelectedIndex != 0 )
{
currentIndex = listBoxControl1.SelectedIndex;