GithubHelp home page GithubHelp logo

larsvommars / checkboxes Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 4.0 39 KB

Console Application Checkboxes in C#

License: MIT License

C# 100.00%
csharp c-sharp checkbox console-application console checkboxes

checkboxes's Introduction

C# Console Application Checkboxes

To use in own System

  1. Possibility

    • Copy Checkbox.cs class to the same directory like Program.cs is in (<Project directory>/<Project name>/Checkbox.cs)
    • Goto your <Project name>.csproj
    • Search for Compile and add in scope of this <ItemGroup> another tag like the others: <Compile Include="Checkbox.cs" />
  2. Possibility

Usage:

Code examples in Checkbox/Program.cs
// First create a Checkbox object

// First parameter is the headline shown above the select boxes
string checkboxHeadline = "Select one of the following options";
// Standarts are no multiple selection and selection is required
// As select option you either can give an array as parameter
string[] opts = {"1. option", "2. option", "3. option" /* ... */};
Checkbox c1 = new Checkbox(checkboxHeadline, opts);
// Or directly as function parameter
Checkbox c2 = new Checkbox(checkboxHeadline, /* options: */ "1. option", "2. option", "3. option" /* ... */);

// If you want to disable requirement of the checkboxes to be checked
Checkbox c3 = new Checkbox(checkboxHeadline, /* multi-mode: */ false, /* required: */ false, opts);


// After creating the Checkbox object
// Call the Select method which returns the selected indices and option strings
var res1 = c1.Select();

Example display would be something like this

image

Example output would be something like this

if using the method like in Checkbox/Program.cs

The integer refers to the index of the option The string refers to the text of the option

2
third option

If multiple options are selected all indices and texts will be outputted

checkboxes's People

Contributors

danyasworld avatar larsvommars avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.