Hey all, I'm new to C# - so please forgive my ignorance.
Basically what I'm trying to do is quite simple - I want a window to appear with a free text box in it, but I want the window to have no borders or title bar and want the text to sit on top of a semi-transparent dark-colored panel.
I set the form to have a transparency key of LimeGreen, then set the RichTextBox to have a Background of LimeGreen. [Oddly this stuff doesn't show up in the code - unless Im missing something]:
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 WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
ControlBox = false;
Text = "";
}
private void panel1_Paint(object sender, PaintEventArgs e)
{
panel1.BackColor = Color.FromArgb(200,Color.Black);
}
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
}
}
}
Anyway, so I have a Panel UNDERNEATH the text box, which I was hoping would mean the text box, being transparent should reveal underneath.
In fact, what happens is the text box is transparent COMPLETELY and shows no panel underneath but rather whatever window or desktop is behind it.
Is there a way to make it work the way I was hoping... or (as I suspect) am I barking up the wrong tree with the WinForms approach and should I be looking into something else?
What I have tried:
What I've tried is the above approach, which in itself was mostly the result of trawling through tutorials and other forum posts online (sadly I can't find anything for my exact use-case). Having about 4 hours experience of C# and Visual Studio, I'm fresh out of ideas... Hence why I'm asking here.