Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Drawing control

Ok, I'm trying to draw textbox on form with 'form load sub' and It's working with default windows form theme, but when you add custom form theme onto form, drawn textbox can't be visible

code:

PHP Code

<?php 
Dim txt 
As New TextBox
txt
.Width = 40
txt
.Height = 37
txt
.BorderStyle = BorderStyle.None
txt
.BackColor = Color.Black
txt
.ForeColor = Color.White
txt
.Font = New Font("Arial", 22)
txt.BringToFront()
Me.Controls.Add(txt)

'I try with SendToBack() on custom form but neither that work 


Big Image Spoiler (Click to View)
Me.Controls.Add(txt) > CustomForm.Controls.Add(txt)
(Aug 6, 2014 10:53 AM)Only3 Wrote:  Me.Controls.Add(txt) > CustomForm.Controls.Add(txt)

I tried that but no luck

Spoiler (Click to View)
its work try this code and play with the location
Dim txt As New TextBox
txt.Width = 40
txt.Height = 37
txt.BorderStyle = BorderStyle.None
txt.BackColor = Color.Black
txt.ForeColor = Color.White
txt.Font = New Font("Arial", 22)
txt.Location = New Point(10, 10)
CustomForm.Controls.Add(txt)
@Only3 thanks but I figured out where I make mistake, I add txt.BringToFront() before adding control to form. It must be after Me.Controls.Add(txt)
txt.BringToFront()
u dont really need bringtofront it will work without it too
Hence this is solved, I'll give ya a tip whenever you are fucking around with custom controls like this. Always copy the code from the designer, it lowers the frustration quite a bit, but if you are trying to do dynamic list kind of stuff, go with a flow panel, aligns everything nicely.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by ۤMD5Aug 31, 2015 05:52 AM 20 1,101 Aug 31, 2015 05:52 AM
Last Post: Mr Whiskey
[.NET] by DoomsapianJul 16, 2013 03:18 AM 10 291 Jul 16, 2013 03:18 AM
Last Post: ᒪeumonic
[.NET] by DoomsapianJul 8, 2013 04:53 AM 1 125 Jul 8, 2013 04:53 AM
Last Post: dreamer66