Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7643683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:30:26+00:00 2026-05-31T09:30:26+00:00

All I want to do is just clear the text box on a button

  • 0

All I want to do is just clear the text box on a button click. I get this error

“Error 2 Cannot implicitly convert type ‘string’ to ‘System.Windows.Forms.TextBox’ C:\Users\Ed\Downloads\BT1_B\BT1_B\Form1.cs 108 36 BT1_B
”

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using System.IO;
using InTheHand;
using InTheHand.Net;
using InTheHand.Net.Sockets;
using InTheHand.Net.Bluetooth;


namespace BT1_B
{
    public partial class Form1 : Form
    {
        Guid service = new Guid("{00001101-0000-1000-8000-00805F9B34FB}");
        BluetoothListener bl;
        BluetoothClient bc;
        bool radioAvailable = false;
        bool listening = false;
        delegate void SettbMessageReceivedCallback(string text);

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            try
            {
                listening = false;
                bl.Stop();
            }
            catch
            {
            }

        }

        private void btn_listen_Click(object sender, EventArgs e)
        {
            try
            {
                BluetoothRadio.PrimaryRadio.Mode = RadioMode.Discoverable;
                radioAvailable = true;
            }
            catch
            {
                MessageBox.Show("Please make sure Bluetooth is available");
            }
            if (radioAvailable)
            {
                bl = new BluetoothListener(BluetoothService.SerialPort);
                bl.Start();
                listening = true;
                System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(ListenLoop));
                t.Start();
            }
        }
        private void ListenLoop()
        {
            try
            {
                while (listening)
                {
                    bc = bl.AcceptBluetoothClient();
                    StreamReader sr = new StreamReader(bc.GetStream());
                    String message = sr.ReadLine();
                    sr.Close();
                    SettbMessageReceived(message);
                }
            }
            catch
            {
            }
        }
        private void SettbMessageReceived(string text)
        {
            try
            {
                if (this.txt_incoming_message.InvokeRequired)
                {
                    SettbMessageReceivedCallback d = new SettbMessageReceivedCallback(SettbMessageReceived);
                    this.Invoke(d, new object[] { text });
                }
                else
                {
                    this.txt_incoming_message.Text += text + "\r\n";
                }
            }
            catch (ThreadAbortException ex)
            {
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void btn_clear_Click(object sender, EventArgs e)
        {
            txt_incoming_message.Clear();
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T09:30:27+00:00Added an answer on May 31, 2026 at 9:30 am
        private void btn_clear_Click(object sender, EventArgs e)
        {
            txt_incoming_message.Text = "";
        }
    

    but please keep the question specific, and do some research before asking for help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I fix that error once and for all? I just want to
How can I get all differences, not just one? I want to use the
All I want is to update an ListViewItem's text whithout seeing any flickering. This
Without thinking about it at all I just want to say I should allow
I'm lazy! And I just want to store one single string value. That's all!
I have a HTML string and want to replace all links to just a
All I want is to get the website URL. Not the URL as taken
All I want is a one pixel black border around my white UILabel text.
I want to have a text input that on focus selects all of the
I hope I'm not being too long winded in this question, I just want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.