Transparent label

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to overlay labels so that text from each label is visible. I searched this site for "Transparent" but surprisingly found no useful information except that the problem is real

Specifically, I am using Windows XP, Framework 1.1, and a Windows form. I have the following setting in the code

Me.lblTradeMark.BackColor = System.Drawing.Color.Transparen

When I display the form the top label completely hides the underlying label.

Another point to consider. My text is centered and I am anchoring the text to the left and right sides to keep the text centered. Any help that works would be appreciated.
 
Hi,

A transparent control will use its parents backgound. So if
lbltrademark's parent is the form it will take the forms backgound and block
the lower label. Try setting the lbltrademark's parent to the lower label.

Ken
 
Hi GenoJoe,

Transparant is always transparant to the parent control.

Or in other words it takes the color from the control it is on.

I hope this helps,

Cor
 
Try setting your transparencykey property to the color you want to be
transparent.


GenoJoe said:
I want to overlay labels so that text from each label is visible. I
searched this site for "Transparent" but surprisingly found no useful
information except that the problem is real.
Specifically, I am using Windows XP, Framework 1.1, and a Windows form. I
have the following setting in the code:
Me.lblTradeMark.BackColor = System.Drawing.Color.Transparent

When I display the form the top label completely hides the underlying label.

Another point to consider. My text is centered and I am anchoring the
text to the left and right sides to keep the text centered. Any help that
works would be appreciated.
 
Hi CJ,

I have given an answer in the thread
VB.NET and SQL to Kevin

I am not sure if it is right, will you check it for me?

It is at the end.

Cor
 
Cor,

Yes and No =)

Your approach is definatly viable, and is a great way to use .NET tools. I
think some flagging will need to be done though in this case if you want to
use OC.

The issue at hand, and Tom has commented on this as well is the fact we are
dealing with the select statement. And as well all know Microsoft has this
grandious idea that in most cases OC will take care of it. In MOST cases
they are correct. But then you get situations like this.

OC works because when you update, yeah, you see the records different, well,
great, but we've already processed it, so we've wasted time and/or done
something out of sync. And because of disconnected datasets, the (RowLock)
directive no longer exists in ADO.NET.

An option, would be to use a Stored Procedure to retreive the record you
want. This would guaruntee that SQL itself will determine what row is being
selected, and could set an appropriate flag saying its "locked"

THEN you could load that data into a ADO.NET Dataset/Table/Row whatever, and
use OC to update the row. Actually OC isn't really needed at that point
because you KNOW your the only person that has it... then you just trip the
flag back to a "processed" state, or whatever you want to call it.

The other way, which I don't really recommend (because I haven't truly
tested it) would be to use a SQL Data Reader, which will give you a server
side foward only cursor, but you *should* be able to use a RowLock directive
to prevent any other sessions to read the row. Again, I haven't tried that.

So, your solution works Cor, it just needed some touching up. The SP route
is probably the easiest way to go and can ensure data integrity.

-CJ
 
Hi CJ,

Sometimes things go terrible wrong, Tom and I had already our conclussion.

Sorry,

It was that last row of mine to Kevin and I thougth that is something CJ
definitly will agree.

:-)

Sorry, Sorry,

Cor
 
Don't apologize. There are about 100 ways to accomplish things in
programming, you commented on that, and you commented on finding the best
road.

But no worries mate, =)

-CJ
 
Back
Top