473,327 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Programatically created label stays invisible. Why?

Decided to try and do it this way just to see if I could. My form appears
with a rectangular hole in the center the size of my label. can anyone tell
me why, and if it can be made visible?

Thanks, Sean

Sub Main()

'Create and format splash form

Dim frmSplash As New Form()

Dim SplashRect As New Rectangle(0, 0, 360, 252)

Dim lblSplashIntro As New Label()

frmSplash.DesktopBounds = SplashRect

frmSplash.FormBorderStyle = FormBorderStyle.None

frmSplash.BackColor = System.Drawing.Color.LightSteelBlue

frmSplash.StartPosition = FormStartPosition.CenterScreen

frmSplash.TopMost = True

lblSplashIntro.Font = New System.Drawing.Font _

("Tahoma", 15.75!, _

System.Drawing.FontStyle.Regular, _

System.Drawing.GraphicsUnit.Point, CType(0, Byte))

lblSplashIntro.Text = "Hey, where am I !!"

lblSplashIntro.Location = New Point(50, 100)

lblSplashIntro.Size = New Size(260, 50)

lblSplashIntro.BackColor = System.Drawing.Color.LightSteelBlue

lblSplashIntro.Enabled = True

lblSplashIntro.Visible = True

frmSplash.Controls.Add(lblSplashIntro)

frmSplash.Show()

'Sleeps for 3 seconds to display splash form

Thread.CurrentThread.Sleep(3000)

frmSplash.Close()

End Sub
Nov 20 '05 #1
4 4219
"What-a-Tool" <Fr***********************@cox.net> schrieb
Decided to try and do it this way just to see if I could. My form
appears with a rectangular hole in the center the size of my label.
can anyone tell me why, and if it can be made visible?

[...]
frmSplash.Show()

'Sleeps for 3 seconds to display splash form

Thread.CurrentThread.Sleep(3000)

When you put the thread to sleep, the splash form is not painted.

To force it to repaint itself immediatelly, call
frmSpash.Refresh
directly after calling Show.

frmSplash.Close()

End Sub

--
Armin

Nov 20 '05 #2
Hello,

"What-a-Tool" <Fr***********************@cox.net> schrieb:
Decided to try and do it this way just to see if I could. My
form appears with a rectangular hole in the center the size of my
label. can anyone tell me why, and if it can be made visible?
Are you sure the 'TransparencyKey' property of the form is not set?
frmSplash.Controls.Add(lblSplashIntro)

frmSplash.Show()
Call 'lblSplashIntro.Refresh' or 'frmSplash.Refresh' here.
'Sleeps for 3 seconds to display splash form

Thread.CurrentThread.Sleep(3000)


--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #3
..Refresh() did the trick - Your the best - Thanks

"What-a-Tool" <Fr***********************@cox.net> wrote in message
news:xCXab.65$0Z5.15@lakeread03...
Decided to try and do it this way just to see if I could. My form appears
with a rectangular hole in the center the size of my label. can anyone tell me why, and if it can be made visible?

Thanks, Sean

Sub Main()

'Create and format splash form

Dim frmSplash As New Form()

Dim SplashRect As New Rectangle(0, 0, 360, 252)

Dim lblSplashIntro As New Label()

frmSplash.DesktopBounds = SplashRect

frmSplash.FormBorderStyle = FormBorderStyle.None

frmSplash.BackColor = System.Drawing.Color.LightSteelBlue

frmSplash.StartPosition = FormStartPosition.CenterScreen

frmSplash.TopMost = True

lblSplashIntro.Font = New System.Drawing.Font _

("Tahoma", 15.75!, _

System.Drawing.FontStyle.Regular, _

System.Drawing.GraphicsUnit.Point, CType(0, Byte))

lblSplashIntro.Text = "Hey, where am I !!"

lblSplashIntro.Location = New Point(50, 100)

lblSplashIntro.Size = New Size(260, 50)

lblSplashIntro.BackColor = System.Drawing.Color.LightSteelBlue

lblSplashIntro.Enabled = True

lblSplashIntro.Visible = True

frmSplash.Controls.Add(lblSplashIntro)

frmSplash.Show()

'Sleeps for 3 seconds to display splash form

Thread.CurrentThread.Sleep(3000)

frmSplash.Close()

End Sub

Nov 20 '05 #4
..Refresh() did the trick - Your the best - Thanks

"What-a-Tool" <Fr***********************@cox.net> wrote in message
news:xCXab.65$0Z5.15@lakeread03...
Decided to try and do it this way just to see if I could. My form appears
with a rectangular hole in the center the size of my label. can anyone tell me why, and if it can be made visible?

Thanks, Sean

Sub Main()

'Create and format splash form

Dim frmSplash As New Form()

Dim SplashRect As New Rectangle(0, 0, 360, 252)

Dim lblSplashIntro As New Label()

frmSplash.DesktopBounds = SplashRect

frmSplash.FormBorderStyle = FormBorderStyle.None

frmSplash.BackColor = System.Drawing.Color.LightSteelBlue

frmSplash.StartPosition = FormStartPosition.CenterScreen

frmSplash.TopMost = True

lblSplashIntro.Font = New System.Drawing.Font _

("Tahoma", 15.75!, _

System.Drawing.FontStyle.Regular, _

System.Drawing.GraphicsUnit.Point, CType(0, Byte))

lblSplashIntro.Text = "Hey, where am I !!"

lblSplashIntro.Location = New Point(50, 100)

lblSplashIntro.Size = New Size(260, 50)

lblSplashIntro.BackColor = System.Drawing.Color.LightSteelBlue

lblSplashIntro.Enabled = True

lblSplashIntro.Visible = True

frmSplash.Controls.Add(lblSplashIntro)

frmSplash.Show()

'Sleeps for 3 seconds to display splash form

Thread.CurrentThread.Sleep(3000)

frmSplash.Close()

End Sub

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: TR | last post by:
Is it possible with CSS to prevent this wrapping alignment with a checkbox with a nested label? This is the label of the checkbox that wraps beneath it I'd prefer it looked like...
4
by: Gibs | last post by:
Hi, How can i make a label visible/invisible? I am able to do it for text box by using document.form1.TextBox1.style.visibility="hidden"; But when i am giving the same for the label, i am getting...
2
by: What-a-Tool | last post by:
Decided to try and do it this way just to see if I could. My form appears with a rectangular hole in the center the size of my label. can anyone tell me why, and if it can be made visible? ...
2
by: Able | last post by:
Dear friends Why is this label invisible: Dim myLbl As New Label myLbl.BorderStyle = BorderStyle.FixedSingle myLbl.BackColor = Color.White myLbl.ForeColor = Color.Black myLbl.Size = New...
3
by: rockdale | last post by:
Hi, All: I have a datagrid with TemplateColumn as following: <asp:TemplateColumn Visible="False" > <ItemStyle Width="0px"></ItemStyle> <ItemTemplate> <asp:Label id="lblMin_Value"...
3
by: Mufasa | last post by:
Is there any real difference between using a hidden field and using a label that is not visible. My thought being that I could leave the labels visible while testing but make them invisible once...
8
fayazmd
by: fayazmd | last post by:
Hi, I am stuck with a problem on labels. I have 30 labels on my from. And from one method i am returning a value, based on it i have to make one label as invisible. I took switch - case, but i...
7
by: The Mad Ape | last post by:
Hi I have code to programatically create a label. It works but when I try to call a sub to create a tooltip it does not work. I do not get an error so have no idea what it wrong. Please review...
0
by: Riverburn | last post by:
C# - using forms using Visual studio 2005 WinXP SP 2 The Title is a bit strange, but I had no idea what else to call my problem. it is a rather specific problem, and I don't know if there is a...
1
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.