forms – Textbox with an unknown value

forms – Textbox with an unknown value – User Experience Stack Exchange

forms – Textbox with an unknow value

I have a textbox where the user can enter a big (or small) number. In the past, an empty value would indicate that they didn’t know the value. Now, the client wants to add an extra step where the user need to specify that they don’t know the value otherwise mark the textbox as mandatory. They think this would increase the chance of people filling up the textbox.

I try to limit the space to make sure the form isn’t to large. I’m looking for a bunch of different ideas. I thought of adding a checkbox beside the textbox (I’m using bootstrap) which would set the textbox as disable.

enter image description here

enter image description here

But it doesn’t look intuitive. I don’t want a bunch of people calling the helpdesk.

visual studio 2019 – Controlar formato y tipo de TextBox c#

estoy haciendo un programa en el que necesito controlar que uno de mis campos TextBox solo contenga números y el otro contenga números y letra mayúsculas con un formato específico (QQQ111). Quiero que haga la comprobación al abandonar el campo, y no cada vez que se escriba en él.
Uso Visual Studio 2019.
Este es mi código:

private void SoloNumeros(KeyPressEventArgs v)
{
   // solo admite del 0-9
   if ((v.KeyChar >= 32 && v.KeyChar <= 47) || (v.KeyChar >= 58 && v.KeyChar <= 255))
   {
      MessageBox.Show("Solo se admiten números", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning);
      v.Handled = true;
      return;
   }
}

private void tNumeroPropuesta_KeyPress(object sender, KeyPressEventArgs e)
{
   SoloNumeros(e);
}

private void LetrasMayusYNumeros(KeyPressEventArgs v)
{
   // solo admite de A-Z y 0-9
   if ((v.KeyChar >= 32 && v.KeyChar <= 47) || (v.KeyChar >= 58 && v.KeyChar <= 255))
   {
      MessageBox.Show("Solo se admiten letras mayúsculas y números siguiendo el siguiente formato: 'QQQ111'", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning);
      v.Handled = true;
      return;
   }
}


private void tNumeroPlaca_KeyPress(object sender, KeyPressEventArgs e)
{
   LetrasMayusYNumeros(e);
}

He visto que para que solo compruebe al final, tengo que usar lo siguiente, pero no sé como hacer que lea los carácteres:

private void tNumeroPropuesta_Leave(object sender, EventArgs e)
{

}

Passing flask textbox value to an infinite while loop

Passing flask textbox value to an infinite while loop | Web Hosting Talk


‘);
var sidebar_align = ‘right’;
var content_container_margin = parseInt(‘350px’);
var sidebar_width = parseInt(‘330px’);
//–>









  1. Passing flask textbox value to an infinite while loop


    I’m running a flask server, with a textbox input and a while loop (in a different thread). I want to pass the input value from the textbox to the while loop.

    This is the .py code:

    Code:

    from flask import Flask, render_template, request
    import thread
    import time
    
    app = Flask(__name__)
    def main():
        
        while True:
            time.sleep(5)
            print "var = "+str(var)
    
    @app.route("/")
    def index():
        
        templateData = {
            'var': var 
    
        }
        return render_template('index.html', **templateData)
    
    @app.route('/', methods=('POST'))
    def post():
        
        global var 
        var = 0
        var = int(request.form('var'))
        return str("var: " + str(var))
        
    if __name__ == "__main__":
        thread.start_new_thread(main, ()) 
        thread.start_new_thread(post, ()) 
        app.run(host='0.0.0.0', port=8083, debug=True)

    This is the .html code:

    HTML Code:

    <!DOCTYPE html>
       <head>
          <title>POST</title>
       </head>
       <body>
        <form method="POST">
            var:<br>
            <input name="var">   
            <br><br>
            Current:    {{ var  }} <br><br>
            <input type="submit">
        </form>
       </body>
    </html>

    I don’t know what is the proper way to get the value to the while loop, because I’m getting mixed signals in the loop. If I for example write 3 in the textbox I’ll get…

    Code:

    var = 0
    var = 3
    var = 0
    var = 3
    var = 0
    var = 3
    var = 0
    var = 3

    …in the while loop, because it’s first reading var = 0 and then var = int(request.form(‘var’))













Similar Threads


  1. Replies: 0


    Last Post: 10-01-2012, 03:56 PM


  2. Replies: 8


    Last Post: 12-05-2005, 05:02 PM


  3. Replies: 9


    Last Post: 09-17-2005, 07:03 PM


  4. Replies: 0


    Last Post: 07-24-2001, 11:32 PM


  5. Replies: 0


    Last Post: 05-12-2001, 02:20 PM

Tags for this Thread



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  








Como mostrar o cargar en un gridview el contenido de un textbox y/o combobox en C# Windows-Form?

Esto es lo que he intentado por el momento, pero no resulta

Me ha habian dicho que utilize el DataRow, pero no se que es eso, la verdad estoy muy verde con esto de c#, si he llegado a ver DataSet antes pero no se si son exclusivos cuando utilizamos una base de datos, tambien creo que me falta la posicion en la que se insertarian los datos, pero no estoy seguro.

using DevExpress.XtraEditors;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Practicar_POO
{
    public partial class Practicas_Gridview : DevExpress.XtraEditors.XtraForm
    {
        public Practicas_Gridview()
        {
            InitializeComponent();
        }

        private void btnCargar_Click(object sender, EventArgs e)
        {
            string a, b;

            a = cboNombres.Text;
            b = txtEdad.Text;

            gvPantalla.DataSource = a;
            gvPantalla.DataSource = b;

        }
    }
}

memória – ARMAZENAR DADOS EM MEMORIA E EXIBIR NO TEXTBOX C#

Bom dia
estou desenvolvendo um projeto de uma calculadora, tenho os botões e os calculos ja ok , queria saber como faço para armazenar os calculos numa string/variavel e exibir os historico dos calculos no textbox, como na calculadora do windows 10 por exemplo

segue abaixo o codigo fonte

namespace Calculadora
{

    public partial class Form1 : Form
    {
        //double n1, n2;
        decimal valor1 = 0, valor2 = 0;
        string operacao = "";
        string historico;



        public Form1()
        {
            InitializeComponent();
        }

    
        private void Form1_Load(object sender, EventArgs e)
        {
            
        }

        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {

        }

        private void menuStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

        private void button7_Click(object sender, EventArgs e)
        {
            textResultado.Text += '0';
        }

        private void button21_Click(object sender, EventArgs e)
        {
            textResultado.Text += '6';
        }

        private void button19_Click(object sender, EventArgs e)
        {

        }

        private void button6_Click(object sender, EventArgs e)
        {
            textResultado.Text += '1';
        }

        private void button8_Click(object sender, EventArgs e)
        {
            textResultado.Text += '2';
        }

        private void button20_Click(object sender, EventArgs e)
        {
            textResultado.Text += '3';
        }

        private void button3_Click(object sender, EventArgs e)
        {
            textResultado.Text += '4';
        }

        private void button9_Click(object sender, EventArgs e)
        {
            textResultado.Text += '5';
        }

        private void button4_Click(object sender, EventArgs e)
        {
            textResultado.Text += '7';
        }

        private void button10_Click(object sender, EventArgs e)
        {
            textResultado.Text += '8';
        }

        private void button22_Click(object sender, EventArgs e)
        {
            textResultado.Text += '9';
        }

        private void button11_Click(object sender, EventArgs e)
        {

        }

        private void button13_Click(object sender, EventArgs e)
        {
            historico = String.Concat(historico, textResultado.Text);
            valor2 = decimal.Parse(textResultado.Text, CultureInfo.InvariantCulture);

            if (operacao == "SOMA")
            {
                
                //historico = String.Concat(historico, "=", Convert.ToString(valor1 + valor2));
                textResultado.Text = Convert.ToString(valor1 + valor2); 
                //textResultado.Text = historico;
               
            }
            else if (operacao == "SUBTRACAO")
            {
                //historico = String.Concat(historico, "=", Convert.ToString(valor1 - valor2));
                textResultado.Text = Convert.ToString(valor1 - valor2);
               // textResultado.Text = historico;
            }
            else if (operacao == "MULT")
            {
                textResultado.Text = Convert.ToString(valor1 * valor2);
            }
            //else if (operacao == "RAIZ")
            //{
            //    textResultado.Text = Convert.ToString(Sqrt(valor1));
            //}
            else if (operacao == "PORCENT")
            {
                textResultado.Text = Convert.ToString(valor1 * (valor2 / 100));

            }
            else
            {
                textResultado.Text = Convert.ToString(valor1 / valor2);
            }
        }

       

        private void button15_Click(object sender, EventArgs e)
        {
            historico = textResultado.Text;
            valor1 = decimal.Parse(textResultado.Text, CultureInfo.InvariantCulture);
            textResultado.Text = "";
            operacao = "SUBTRACAO";
            lblOperacao.Text = "-";
            historico = String.Concat(historico, lblOperacao.Text);
        }

        private void button16_Click(object sender, EventArgs e)
        {
            valor1 = decimal.Parse(textResultado.Text, CultureInfo.InvariantCulture);
            textResultado.Text = "";
            operacao = "MULT";
            lblOperacao.Text = "x";
            historico = textResultado.Text;
        }

        private void button17_Click(object sender, EventArgs e)
        {
            valor1 = decimal.Parse(textResultado.Text, CultureInfo.InvariantCulture);
            textResultado.Text = "";
            operacao = "DIVISAO";
            lblOperacao.Text = "÷";
            historico = textResultado.Text;
        }

        private void button14_Click(object sender, EventArgs e)
        {
            historico = textResultado.Text;
            valor1 = decimal.Parse(textResultado.Text, CultureInfo.InvariantCulture);
            textResultado.Text = "";
            operacao = "SOMA";
            lblOperacao.Text = "+";
            historico =  String.Concat(historico, lblOperacao.Text);
        }

        private Font bold = new Font(FontFamily.GenericSansSerif, 10, FontStyle.Bold);

        private void toolStripMenuItem1_Click_1(object sender, EventArgs e)
        {

        }

        private void historicoToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void button12_Click(object sender, EventArgs e)
        {
            textResultado.Text = "";
            lblOperacao.Text = "";
        }

        private void button24_Click(object sender, EventArgs e)
        {
            textResultado.Text = "";
            lblOperacao.Text = "";
            valor1 = 0;
            valor2 = 0;
        }

        private void button23_Click(object sender, EventArgs e)
        {
            valor1 = decimal.Parse(textResultado.Text, CultureInfo.InvariantCulture);
            textResultado.Text = "";
            operacao = "RAIZ";
            lblOperacao.Text = "²√x";
            historico = textResultado.Text;
        }

        private void imprimirToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            valor1 = decimal.Parse(textResultado.Text, CultureInfo.InvariantCulture);
            textResultado.Text = "";
            operacao = "PORCENT";
            lblOperacao.Text = "%";
            historico = textResultado.Text;
        }

        private void textResultado_TextChanged(object sender, EventArgs e)
        {

        }

        protected override void WndProc(ref Message message)  //Bloquear maximizar e redimensionamento da calculadora
        {
            const int WM_SYSCOMMAND = 0x0112;
            const int SC_MOVE = 0xF010;

           // switch (message.Msg)     //Para o movimento da calculadora
           //{
           //    case WM_SYSCOMMAND:
           //        int command = message.WParam.ToInt32() & 0xfff0;
           //        if (command == SC_MOVE)
           //           return;
           //        break;
           // }

            base.WndProc(ref message);
        }

       
    }

}

arduino – How can i get UID RFID to Textbox Laravel

so i have a project laravel with RFID. when i want to post data, it require UID form RFID reader. but error looks like URL not found on server? how can i fix this? can anyone help me?

this is my Laravel ManjmhsController

public function create()
    {
        return view('addmhs');
    }

public function store(Request $request)
    {
        $request->validate((
            'uid'           => 'required',
            'nim'           => 'required|unique:mahasiswa',
            'nama_mhs'      => 'required',
            'foto'          => 'mimes:jpg,jpeg,png,gif,svg,JPG,PNG,JPEG',
            'tempat_lahir'  => 'required',
            'tgl_lahir'     => 'required',
            'kelas'         => 'required',
            'jurusan'       => 'required',
            'alamat'        => 'required',
            'email'         => 'required|max:50|string|email|max:255',
            'no_telfon'     => 'required',
            'saldo'         => 'required' 
        ));

        if ($request->hasFile('foto')) {
            $foto = $request->file('foto');
            $ext = $foto->getClientOriginalExtension();
            $fotoName = $request->nama_mhs . date('YmdHis') . '.' . $ext;
            $path = public_path('img/');
            $foto->move($path, $fotoName);
        } else {
            $fotoName = 'default.png';
        }
        
        $only = $request->only('uid','nim', 'nama_mhs', 'tempat_lahir', 'tgl_lahir', 'kelas', 
                                'jurusan', 'alamat', 'email', 'no_telfon', 'saldo');
        $dataFoto = (
            'foto' => $fotoName
        );
        $data = array_merge($only, $dataFoto);
        Mahasiswa::create($data);

        return redirect('manjmhs');

    }

this is my arduino script


#include <ESP8266WebServer.h>
#include <ESP8266HTTPClient.h>

#include <SPI.h>
#include <MFRC522.h>

#define SS_PIN D2  //--> SDA / SS is connected to pinout D2
#define RST_PIN D1  //--> RST is connected to pinout D1
MFRC522 mfrc522(SS_PIN, RST_PIN);  //--> Create MFRC522 instance.

#define ON_Board_LED 2 

const char* ssid = "DAVIAN";
const char* password = "gakdipassword";

ESP8266WebServer server(80);  //--> Server on port 80

int readsuccess;
byte readcard(4);
char str(32) = "";
String StrUID;

void setup() {
  Serial.begin(115200); //--> Initialize serial communications with the PC
  SPI.begin();      //--> Init SPI bus
  mfrc522.PCD_Init(); //--> Init MFRC522 card

  delay(500);

  WiFi.begin(ssid, password); //--> Connect to your WiFi router
  Serial.println("");

  pinMode(ON_Board_LED, OUTPUT);
  digitalWrite(ON_Board_LED, HIGH); //--> Turn off Led On Board

  //----------------------------------------Wait for connection
  Serial.print("Connecting");
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    //----------------------------------------Make the On Board Flashing LED on the process of connecting to the wifi router.
    digitalWrite(ON_Board_LED, LOW);
    delay(250);
    digitalWrite(ON_Board_LED, HIGH);
    delay(250);
  }
  digitalWrite(ON_Board_LED, HIGH); //--> Turn off the On Board LED when it is connected to the wifi router.
  //----------------------------------------If successfully connected to the wifi router, the IP Address that will be visited is displayed in the serial monitor
  Serial.println("");
  Serial.print("Successfully connected to : ");
  Serial.println(ssid);
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());

  Serial.println("Please tag a card or keychain to see the UID !");
  Serial.println("");
}

void loop() {
  // put your main code here, to run repeatedly
  readsuccess = getid();

  if (readsuccess) {
    digitalWrite(ON_Board_LED, LOW);
    WiFiClient client;
    HTTPClient http;    //Declare object of class HTTPClient

    String UIDresultSend, postData;
    UIDresultSend = StrUID;

    //Post Data
    postData = "uid=" + UIDresultSend;

    http.begin(client, "http://192.168.1.7/manjmhs/create");  //Specify request destination
    http.addHeader("Content-Type", "application/x-www-form-urlencoded"); //Specify content-type header

    int httpCode = http.POST(postData);   //Send the request
    String payload = http.getString();    //Get the response payload

    Serial.println(UIDresultSend);
    Serial.println(httpCode);   //Print HTTP return code
    Serial.println(payload);    //Print request response payload

    http.end();  //Close connection
    delay(500);
    digitalWrite(ON_Board_LED, HIGH);
  }
}

int getid() {
  if (!mfrc522.PICC_IsNewCardPresent()) {
    return 0;
  }
  if (!mfrc522.PICC_ReadCardSerial()) {
    return 0;
  }


  Serial.print("THE UID OF THE SCANNED CARD IS : ");

  for (int i = 0; i < 4; i++) {
    readcard(i) = mfrc522.uid.uidByte(i); //storing the UID of the tag in readcard
    array_to_string(readcard, 4, str);
    StrUID = str;
  }
  mfrc522.PICC_HaltA();
  return 1;
}

void array_to_string(byte array(), unsigned int len, char buffer()) {
  for (unsigned int i = 0; i < len; i++)
  {
    byte nib1 = (array(i) >> 4) & 0x0F;
    byte nib2 = (array(i) >> 0) & 0x0F;
    buffer(i * 2 + 0) = nib1  < 0xA ? '0' + nib1  : 'A' + nib1  - 0xA;
    buffer(i * 2 + 1) = nib2  < 0xA ? '0' + nib2  : 'A' + nib2  - 0xA;
  }
  buffer(len * 2) = '';
}

and this is my error looks like
error monitor

can anyone please help me? thank you

c# – Como alterar a tabulação padrão no TextBox do Winforms?

Eu tenho um TextBox e quando aperto TAB o espaço de tabulação no TextBox é muito grande. Gostaria de personalizar isso mas não encontrei nada nas propriedades que possa ajudar.

inserir a descrição da imagem aqui

c# – Atualizar planilha excel com texto de textbox

Estou tentando atualizar os dados de uma planilha pelo textbox. Tentei o código abaixo e o mesmo não gerou nenhuma exceção, mas não atualizou a planilha.

private void button2_Click(object sender, EventArgs e)
{

        try
        {

            OleDbCommand command = new OleDbCommand();
            command.CommandText = "update (Designa$) set Nome = '" + textBox1.Text + "' where Cod = '"+textBox2.Text+"'";
            command.Parameters.Add(new OleDbParameter("@Nome",textBox1.Text));
            command.Parameters.Add(new OleDbParameter("@Cod", textBox2.Text));

            MessageBox.Show("Dados Atualizados....");
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

    }

DreamProxies - Cheapest USA Elite Private Proxies 100 Cheapest USA Private Proxies Buy 200 Cheap USA Private Proxies 400 Best Private Proxies Cheap 1000 USA Private Proxies 2000 USA Private Proxies 5000 Cheap USA Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive.com Proxies-free.com New Proxy Lists Every Day Proxies123.com Proxyti.com Buy Quality Private Proxies