Click to See Complete Forum and Search --> : Create my own controls?


trichard
July 16th, 2003, 03:23 PM
I want to create controls (buttons, comboboxes etc.) with my own look. Can this be done with gdi+ or directx (preferrably gdi+). I have already done it using flash but I'm new to C++ .Net and I'm having trouble. I've checked this site and several others and haven't found what I'm looking for. So far all I've been able to do is put a bitmap on top of a windows button but I can still see the edges of the windows button because the bitmap isn't rectangular. Also, I'm using a bitmap for the background of my form and if I make the button transparent before I put the bitmap on it, the background color shows through, not the bitmap. Any help would be greatly appreciated. Here's the code that I'm using...

/*Set up the main form to be a full screen with a bitmap
appearance*/
CppWindow() {
Text = S"Drawing";
ClientSize = System::Drawing::Size(300,300);
FormBorderStyle = FormBorderStyle::None;
WindowState = FormWindowState::Maximized;
SetupForm();
Paint += new PaintEventHandler(this,
&CppWindow::Form_Paint);
}

// Paints the background and button
void Form_Paint(Object*pSender, PaintEventArgs* pe) {
Graphics* pp = CreateGraphics();
Image* image = new Bitmap("DefaultDesktop.jpg");
TextureBrush* tBrush = new TextureBrush(image);
pp->FillRectangle(tBrush, ClientRectangle);
pp->Dispose();
image1 = new Bitmap("connecton.png");
drawBtn->set_BackgroundImage(image1);
drawBtn->Size = drawBtn->BackgroundImage->Size;
}

Thanks