Giovanni Siccardi

Giovanni Siccardi

  • 1.2k
  • 408
  • 1.3k

"Hello World " focused

Feb 22 2019 12:56 PM
Sorry for my very stupid question, but as absolute beginner ...
 
I run the below small program.
It works, but I get the text written  on white color over blue band.
If I click ( with the mouse) in the text box , the text became black on white background.
I would like get from program the text  black on white background without any click needed.
Something related to focus ?
Thanks for any help.
 
 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 TextBoxSample
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
textBox1.Clear();

textBox1.Text += " Hello \r\n";

textBox1.Text += " la data di oggi e' \r\n";
textBox1.Text += "\r\n";
textBox1.Text += (DateTime.Now.ToString(" dd/MM/yyyy H:mm tt"));
//textBox1.Text += "\r\n";

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

Answers (4)