Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.NET completely green

Status
Not open for further replies.

GrigoreDolghin

Programmer
Oct 23, 2000
167
RO
Hello, everyone

I am coming from Visual FoxPro, where I know what I have to do almost every time. Now I'm trying to switch to VB.NET, a completely new language for me. Extremely frustrating. In VB I am a complete moron :)

Two simple questions:

1. How can one make a completely transparent label? All I know right now is I can set the backcolor as transparent and I can see the form underneath, but not the rest of the controls. The label is transparent for the form, but opaque for another label below it

2. I put three label on a form. Run the exe. Suprise. I can see how vb draws those labels. Very fast, is true, but still visible. What the ...? It can't draw three labels? What about 50 controls in the same form?

I'm sorry for my frustration, but I had enough for a single day - it's hard to search 6 hours in msdn the VB's equivalent for WAIT instruction.... I found it, it seems to be SLEEP, but 6 hours? I have a life to live!

Thank you Grigore Dolghin
Class Software
Bucharest, Romania
 
1) It sounds like you do not want to see the label, so set the Visible feature to false.

2) I am uncertain how you did this to make a good reply. I find text labels to work quite well. I will agree that the .Net framework is not built for graphics speed. I have issue with it on this topic as well.

3) God bless you for attempting to use MSDN. Anyway, why do you want to wait?

A) Give the program time to display its information?
This is a REAL problem in MicroSoft programs in general, and the idiots there seem not to notice. I mean, they write their code to run, but their code does not 'see' the information until it has been set on the screen. If they used their own programs, they should have certainly caught this problem. Anyway, the word is REFRESH. I type this command after every serious update of information and before I start using that data.

B) Give the user time to do whatever?
Uh, what is your program doing? My programs sit there with nothing to do until the user does something. You need to think in that fashion. Package your code in event traps (ie. clicks on a certain field).

C) Okay, you just want to pass the time. Sometimes, depending on the version of VB (VBA) you need to tell one section of code on one form to wait while another form (which the previous section of code caused to display) is being active. Note that what I am showing here is VB5 code. V.Net I believe is the same, but have not had a need to include and check yet.

Dim TI as Single
TI = Timer + 3 (or however many seconds you want)
Do While Timer<TI
DoEvents
Loop

Note that in the above example of one set of code displaying a form then needing to wait while that form is active: (K is an Integer)

K = 0
Do While K<6
DoEvents
Loop

I then have the other form set K=9 whenever the user terminates or closes that form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top