label backcolor set to 'transparent' not working
label backcolor set to 'transparent' not working
label backcolor set to 'transparent' not working
label backcolor set to 'transparent' not working
label backcolor set to 'transparent' not working
label backcolor set to 'transparent' not working label backcolor set to 'transparent' not working label backcolor set to 'transparent' not working label backcolor set to 'transparent' not working label backcolor set to 'transparent' not working label backcolor set to 'transparent' not working label backcolor set to 'transparent' not working label backcolor set to 'transparent' not working
label backcolor set to 'transparent' not working label backcolor set to 'transparent' not working
label backcolor set to 'transparent' not working
Go Back  Xtreme Visual Basic Talk > > > label backcolor set to 'transparent' not working


Reply
 
Thread Tools Display Modes
  #1  
Old 08-21-2012, 11:19 AM
HappyJoni's Avatar
HappyJoni HappyJoni is offline
Centurion
 
Join Date: Jun 2003
Location: New Jersey
Posts: 169
Default label backcolor set to 'transparent' not working


Hello,

I'm using VB.net (Visual Studio 2005). I have a label on my form and I'm trying to make the backcolor transparent because I have an image behind it. I set the backcolor property to 'transparent' in the properties window but it's not working.

Is there something else I"m supposed to do?


Thanks!
Joni
Reply With Quote
  #2  
Old 08-21-2012, 11:47 AM
DrPunk's Avatar
DrPunklabel backcolor set to 'transparent' not working DrPunk is offline
Senior Contributor

* Expert *
 
Join Date: Apr 2003
Location: Never where I want to be
Posts: 1,403
Default

No. Transparency really doesn't work properly in winforms applicaations. It works better in WPF applications, but with VS2005 you're a bit stuck on using that.

Drawing your own text onto the canvas instead of using a label might be the easiest solution.
__________________
There are no computers in heaven!
Reply With Quote
  #3  
Old 08-21-2012, 01:48 PM
Gruff's Avatar
Grufflabel backcolor set to 'transparent' not working Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

To expand on what the good Doctor is saying...
Code:
Imports System.Drawing Public Class Form1 Dim myFakeLabel As String = "" Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click myFakeLabel = "Greetings and Salutations!" ' Force form to redraw Me.Invalidate() End Sub Private Sub Form1_Paint(sender As Object, e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint With e.Graphics Dim b As Brush = Brushes.Blue .DrawString(myFakeLabel, Me.Font, b, New Point(30, 30)) End With End Sub End Class
__________________
Burn the land and boil the sea
You can't take the sky from me


~T
Reply With Quote
  #4  
Old 08-21-2012, 05:54 PM
DrPunk's Avatar
DrPunklabel backcolor set to 'transparent' not working DrPunk is offline
Senior Contributor

* Expert *
 
Join Date: Apr 2003
Location: Never where I want to be
Posts: 1,403
Default

I find that TextRenderer.DrawText gets closer results to how a label looks than drawstring.
__________________
There are no computers in heaven!
Reply With Quote
  #5  
Old 08-22-2012, 08:55 AM
Gruff's Avatar
Grufflabel backcolor set to 'transparent' not working Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

Thanks for the update Doc. I did not know that.

Edit:
I think I see what you are saying... looks like DrawText compacts the characters tighter left to right, otherwise the same height top to bottom.
__________________
Burn the land and boil the sea
You can't take the sky from me


~T

Last edited by Gruff; 08-22-2012 at 09:59 AM.
Reply With Quote
  #6  
Old 08-29-2012, 06:49 AM
boops boops's Avatar
boops boops boops boops is offline
Centurion
 
Join Date: Dec 2006
Location: Holland and France
Posts: 146
Default

WinForms transparency is a bit simpler than some people would like, but to claim "it doesn't work properly" is a bit misleading: it works the way it was designed to work.

WinForms control transparency follows this rule: show the Parent. Normally the parent is the top level form but it doesn't have to be. In particular, happyJoni can make the label transparent over the image in two lines of code (insert your own control names):
Code:
Label1.Parent = PictureBox1
Label1.Location.Offset(- PictureBox1.Left, - PictureBox1.Top)
You could put that in the Form Load sub. The second line is needed to keep the label from moving to a new position, because the control location is relative to its parent.

BB
Reply With Quote
  #7  
Old 08-29-2012, 07:32 AM
AtmaWeapon's Avatar
AtmaWeaponlabel backcolor set to 'transparent' not working AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

Small suggestion: if you're just getting started and it is an option, learn WPF. It was designed in the last decade and supports transparency without the need to do hacks.

What boops boops said is mostly correct; PictureBox is sort of a special case. In general, setting the background to Transparent in Windows Forms follows the rule, "I will show the background color of the parent control". Sometimes you get full transparency, other times you've got to do extra tricks. It's not GDI+'s fault; when it was designed there was no such thing as a GPU and in fact having a mouse was a luxury.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #8  
Old 08-29-2012, 09:27 AM
boops boops's Avatar
boops boops boops boops is offline
Centurion
 
Join Date: Dec 2006
Location: Holland and France
Posts: 146
Default

Quote:
Originally Posted by AtmaWeapon View Post
Small suggestion: if you're just getting started and it is an option, learn WPF. It was designed in the last decade and supports transparency without the need to do hacks.

What boops boops said is mostly correct; PictureBox is sort of a special case. In general, setting the background to Transparent in Windows Forms follows the rule, "I will show the background color of the parent control". Sometimes you get full transparency, other times you've got to do extra tricks. It's not GDI+'s fault; when it was designed there was no such thing as a GPU and in fact having a mouse was a luxury.
It's not just the background color. Besides the background color of the parent, transparency shows the background image, anything drawing on the control in the Paint event handler, and, in the case of a picture box, the Image. What it won't show, of course, is other controls hosted by the same parent. The child control with a transparent background is alpha-blended to the parent. That means you can put a Label with a semi-transparent background color or image on a picture box, and it will show correctly. Furthermore, you can stack several generations; for example, you could have a User Control parenting a Label and a PictureBox in turn parented by a Panel; the stack will be correctly alpha blended.

The only seeming oddity is that the Visual Studio Designer doesn't support dragging child controls onto a PictureBox -- unlike a UserControl, Panel, FlowlayoutPanel etc. But it is supported in code and it takes all of 2 lines. I suppose you could call that a hack, in the sense that it's a trivial piece of information which several ostensible experts on this GDI+/Graphics forum didn't know about.

BB
Reply With Quote
  #9  
Old 08-29-2012, 09:31 AM
DrPunk's Avatar
DrPunklabel backcolor set to 'transparent' not working DrPunk is offline
Senior Contributor

* Expert *
 
Join Date: Apr 2003
Location: Never where I want to be
Posts: 1,403
Default

I think I might be guilty of getting "really" and "doesn't" the wrong way round.
__________________
There are no computers in heaven!
Reply With Quote
  #10  
Old 08-29-2012, 10:05 AM
AtmaWeapon's Avatar
AtmaWeaponlabel backcolor set to 'transparent' not working AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

Yeah, it looks like *if* you're willing to do the bulk of your layout code by hand in code you are right, boops boops. I thought I had proof you were wrong, but the reality was the designer was still adding my label to the Form's Controls collection.

I still posit that WPF's "set the Background property to Brushes.Transparent" is easier and more intuitive than "double-check that the designer is doing nothing with your control and make sure its parent is the one you want, and also be comfortable with not being able to overlap child controls".
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #11  
Old 08-29-2012, 03:36 PM
boops boops's Avatar
boops boops boops boops is offline
Centurion
 
Join Date: Dec 2006
Location: Holland and France
Posts: 146
Default

Quote:
Originally Posted by AtmaWeapon View Post
Yeah, it looks like *if* you're willing to do the bulk of your layout code by hand in code you are right, boops boops. I thought I had proof you were wrong, but the reality was the designer was still adding my label to the Form's Controls collection.

I still posit that WPF's "set the Background property to Brushes.Transparent" is easier and more intuitive than "double-check that the designer is doing nothing with your control and make sure its parent is the one you want, and also be comfortable with not being able to overlap child controls".
I gave a simple answer to a simple question. If you recommend doing it in WPF instead, perhaps you could post a detailed example which the OP can use. Of course, there aren't any picture boxes so it might take some explanation. And no XAML please: that would be hand coding, wouldn't it? BB
Reply With Quote
  #12  
Old 08-29-2012, 07:13 PM
hDC_0label backcolor set to 'transparent' not working hDC_0 is offline
Contributor

* Expert *
 
Join Date: Feb 2004
Posts: 559
Default setting ( dynamically at runtime ) a picturebox control as parent for child controls

Quote:
Originally Posted by boops boops
The only seeming oddity is that the Visual Studio Designer doesn't support dragging child controls onto a PictureBox -- unlike a UserControl, Panel, FlowlayoutPanel etc. But it is supported in code and it takes all of 2 lines. I suppose you could call that a hack, in the sense that it's a trivial piece of information which several ostensible experts on this GDI+/Graphics forum didn't know about.
Thank you boops boops for this interesting (if under-documented) tidbit!

In this old 2005 MSDN article it says:
Quote:
The Visual Basic 2005 PictureBox control is not a container control;
it is only used to display pictures.
You can use the new Panel control as a replacement for the PictureBox
control where you need a container control.
...and of course I noticed the "oddity" you mentioned and
just accepted that the Panel is basically the container control
that replaced the picturebox control, but this is somewhat not true.

Looking back at the 2003 version of that article it has a cross referencing chart which correctly lists:

PictureBox Properties
Visual Basic 6.0.................Visual Basic .NET Equivalent
....Container...............................Parent

However what exactly would be the code to do this?

To answer that question I made up a quick new VB.Net project adding
the following controls to Form1:
Picturebox1 - set backcolor to light purple, location (118, 0)
Picturebox2 - set backcolor to transparent, borderstyle to fixedsingle
Label1
Textbox1
Button1

Then used this code:
Code:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
  Label1.Parent = PictureBox1
  TextBox1.Parent = PictureBox1
  PictureBox2.Parent = PictureBox1
  PictureBox1.Location = New Point(215, 200)
End Sub
Three things happened:
1.) Picturebox1 moved
2.) The controls repositioned themselves inside the Picturebox1 control
and moved when the Picturebox1 moved,
(indicated they had been correctly "re-container-ized")
3.) The color inside Picturebox2 correctly shows thru (transparently)
as light purple from the backcolor of its container control Picturebox1.

It should be noted in doing this re-parenting,
that whatever the control's previous Location X and Y positioning
(that the controls had in relation to the upper left corner of Form1),
these same x and y location values were duplicated in the offset
from the upper left corner of their new Picturebox control parent container.

There may also be some validation and serialization difficulties
in regard to using a Picturebox control as a Parent container.
A quick search found these two off forum threads:
Validating event not fired for child controls of picturebox
Serialize a picturebox with all it's child controls

The question then becomes ():
Quote:
Why did Microsoft decide that you could not drag or
copy/paste child controls into a picturebox control at design time?

Last edited by hDC_0; 08-29-2012 at 07:31 PM.
Reply With Quote
  #13  
Old 08-30-2012, 03:35 AM
boops boops's Avatar
boops boops boops boops is offline
Centurion
 
Join Date: Dec 2006
Location: Holland and France
Posts: 146
Default

Quote:
Originally Posted by hDC_0 View Post
Thank you boops boops for this interesting (if under-documented) tidbit!

In this old 2005 MSDN article it says:
...and of course I noticed the "oddity" you mentioned and
just accepted that the Panel is basically the container control
that replaced the picturebox control, but this is somewhat not true.
Not literally "replaced", since both controls were in .Net Framework from the outset. But the design-time parenting behaviour is clearly implemented only for container controls, which a picture box isn't.

Quote:
A quick search found these two off forum threads:
Validating event not fired for child controls of picturebox
Serialize a picturebox with all it's child controls

The question then becomes ():
In the first of those threads, I disagree with one thing: you can select a picture box with its Select method, and when you do so it will raise Validation events and (more usefully, from my viewpoint) MouseWheel events. But yes it's unwise to rely on a picture box as a general purpose container control. More robust perhaps would be to adapt a Panel or UserControl, possibly docking a PictureBox into it. The idea is similar to using a container such as a Grid or StackPanel to provide additional behaviours in WPF, although without the convenience of routed events.

BB
Reply With Quote
  #14  
Old 08-30-2012, 08:20 AM
AtmaWeapon's Avatar
AtmaWeaponlabel backcolor set to 'transparent' not working AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

Quote:
Originally Posted by boops boops View Post
I gave a simple answer to a simple question. If you recommend doing it in WPF instead, perhaps you could post a detailed example which the OP can use. Of course, there aren't any picture boxes so it might take some explanation. And no XAML please: that would be hand coding, wouldn't it? BB
Challenge accepted, with brief explanation.

I'm going to ignore "XAML" is hand-coding. WPF has a XAML designer. I will voluntarily use it instead of hand-typing XAML. Seeing as the WinForms designer can't parent a label into a PictureBox, I think WPF still wins.

Here ya go, done completely with the designer:
Code:
<Window x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Image Name="Image1" Stretch="Uniform" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Source="https://www.google.com/images/srpr/logo3w.png" />
        <Label Content="I AM A LABELLLLL" Height="75" HorizontalAlignment="Left" Margin="88,106,0,0" Name="Label1" VerticalAlignment="Top" Width="304" FontSize="22" />
    </Grid>
</Window>
I'm not really sure what kind of detailed explanation is needed, but I'll do so.

The <Window> tag is cruft. It's like "Public Class Form1 Inherits Form"; you get used to it just being there and don't pay attention to it.

The <Grid> tag is the container for the content. A Window can only have one direct child, so it almost always contains a panel like this. I could've used Canvas too but you get a Grid by default.

The <Image> element is the equivalent of the PictureBox control. Uniform stretch means it keeps the image aspect ratio but makes it big enough to fit. The Vertical/HorizontalAlignment properties are equivalent to setting a WinForms control's Dock property to Fill. The Source property dictates what image to use; I'm using Google's logo.

The <Label> element is self-explanatory. Content is the equivalent of Text; I arranged it so it was overlapping the image. Neat fact: by default its background is transparent so in WPF Label elements automatically do what you want. Unless what you want is "have a background color".

Had I been using a local image, I could've done this entire project without my hand leaving the mouse. (Granted, I couldn't have typed the label text.) WinForms designer can't do that. Which was my point. The answer in WPF is "what you want to do works exactly as you would expect."

Or, the main reason I advocate for its use, "If you were using WPF you wouldn't have had to make a forum post."

(Fun side note: I could overlay a label over a video in WPF in pretty much the same way, using MediaElement instead of Image or a myriad of other one-line tricks. I don't believe WinForms can do this stupid pet trick without assistance from DirectX. The benefits of using code designed for modern applications!)
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #15  
Old 08-31-2012, 06:11 PM
boops boops's Avatar
boops boops boops boops is offline
Centurion
 
Join Date: Dec 2006
Location: Holland and France
Posts: 146
Default

Hi Atma, I didn't expect you to go to such lengths in response but I appreciate your effort. I think it is useful as an illustration of how much has to be explained for someone acquainted only with Windows Forms, even for something as minor as putting a transparent label in front of a picture.

I agree that WPF is a considerably more powerful and versatile GUI design tool than WinForms. Besides a better transparency model, it makes better use of graphics hardware and offers bitmap effects, style portability, animation methods and much else.

People usually learn VB.Net and other Net languages in conjunction with the Windows Forms Designer: that's why the languages are called Visual. Start a Form, throw on a couple of buttons and a text box, and you can program something that works on your first day. In theory you could do the same in WPF, but the problem is how to progress from there. You can't really do much more in WPF without reading and editing XAML -- among other reasons because without it you can't find examples on the web or get help on forums. You also need to know about container/content controls, dependency properties, the resource model, routed events, triggers etc. And there are countless WPF classes to learn about. To make things confusing, controls and classes often have the same names as things in WinForms but are wholly different: images, rectangles, points etc.

It makes sense to recommend moving to WPF to someone who is fairly experienced and/or keen on specializing in GUI design. But to relative beginners, it must sound like a put-down, a bit like "Let Me Google That For You" or "read the documentation". It's particularly unhelpful when the question can be answered within WinForms anyway. Referring to the question of this thread, setting the Parent property isn't the only option. I could have said to use a panel instead of a picture box (if the OP had done that the question would have been how to deal with flickering when the image changes, also easily solved). Or draw the label in a Paint handler as Gruff suggested (more work, but a lot less than migrating to WPF).

By the way, if you want to show text etc. in front of a video or multiple controls in WinForms, use a modeless dialog box and its Opacity, TransparencyKey and/or Region properties. No per-pixel alpha blending but, hey, transparency is going out of fashion anyway. Metro anyone?

BB
Reply With Quote
  #16  
Old 09-01-2012, 04:10 PM
AtmaWeapon's Avatar
AtmaWeaponlabel backcolor set to 'transparent' not working AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

Eh. When I look into my crystal ball 10 years from now, I see the thing that replaces WPF and it's very WPF-like. Cocoa on the mac is similar in a lot of ways. Like it or not, it's the state of the art in UI framework engineering and the future is going to look more like WPF than Windows Forms.

So I think it's kind of cruel to start everyone with WinForms. It's sort of like insisting they learn VB6 before VB .NET. Sure, it's still marketable and I bet 10 years from now there's still going to be WinForms jobs. But we especially shouldn't limit the horizons for people who will be inheriting our jobs. WPF isn't harder to learn than Windows Forms. It's just newer and less familiar.

You guys can write the posts about transparency hacks for WinForms. I got tired of fiddling with it. I'll leave the comments that it's much easier in WPF
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #17  
Old 09-02-2012, 04:08 PM
hDC_0label backcolor set to 'transparent' not working hDC_0 is offline
Contributor

* Expert *
 
Join Date: Feb 2004
Posts: 559
Default into the future..learning with VB6 and adjusting learning to the learner..

Quote:
Originally Posted by AtmaWeapon
Granted, I couldn't have typed the label text
Couldn't you have typed text using a mouse with a virtual keyboard?
How to find Windows 7 On-Screen Keyboard
Type without using the keyboard (On-Screen Keyboard)

I recently saw news story on a tech startup
where all the interns only got tablets without keyboards
and they have to do java programming for Android apps with that setup - how weird (),
but I guess it's do-able in a pinch
(when you are a company in bootstrap mode desperately trying to save money).

Quote:
Originally Posted by AtmaWeapon
When I look into my crystal ball 10 years from now, I see the thing that replaces WPF and it's very WPF-like.
Cocoa on the mac is similar in a lot of ways.
Like it or not, it's the state of the art in UI framework engineering
and the future is going to look more like WPF than Windows Forms.
I agree with both these statements.
Because Cocoa is so state of the art it generally makes Metro "ugly blocks" GUI look like a huge kludge by comparison.

I think the recent legal decision Apple won over Samsung
was far too over-reaching in the way it makes
not just GUI graphic elements patentable,
but GUI "behavior" as well.

I can see the court lawsuits already:
"Did that scroll motion snap into place, or drift back..or actually 'bounce'?"
--with billions of dollars in fines hanging in the balance.

Quote:
Originally Posted by boops boops
..hey, transparency is going out of fashion anyway. Metro anyone?
I suspect this is a bit of sarcasm (with tongue planted firmly in cheek).
Personally I try "bite my tongue",
and to keep my temptations to make such tongue-in-cheek statements to a minimum,
knowing that there are many non-English speaking
forum members out there who might (mistakenly) take such statements at face value.
Sad as it is to say,
most of the people who spent thousands of dollars on upgrading their computer hardware in recent years,
did so just for a little non-client area transparency (i.e. the Aero Glass look) --that
was the "justification" for many people,
in regard to upgrading from WinXP to Windows Vista or Windows7.

Quote:
Originally Posted by AtmaWeapon
So I think it's kind of cruel to start everyone with WinForms.
It's sort of like insisting they learn VB6 before VB .NET. Sure, it's still marketable
and I bet 10 years from now there's still going to be WinForms jobs.
But we especially shouldn't limit the horizons for people who will be inheriting our jobs.
Quote:
Originally Posted by boops boops
People usually learn VB.Net and other Net languages in conjunction with the Windows Forms Designer: that's why the languages are called Visual.
Start a Form, throw on a couple of buttons and a text box, and you can program something that works on your first day.
You can't really do much more in WPF without reading and editing XAML -- among other reasons
because without it you can't find examples on the web or get help on forums.
You also need to know about container/content controls, dependency properties, the resource model, routed events, triggers etc.
And there are countless WPF classes to learn about.
To make things confusing, controls and classes often have the same names as things in WinForms
but are wholly different: images, rectangles, points etc.
I'm with boops boops on this one.
I don't think it is "cruel" at all to have a developer (with the appropriate level of ability),
to be taught to be "well rounded", and to be able to handle VB.Net Winforms, VB6, and WPF.

A learning curve is a learning curve is a learning curve.
If you are struggling with the .Net WinForms learning curve
does jumping into WPF/Xaml programming mean that
you know longer have a learning curve to climb?

Being familiar with all different types of general programming
(C/C++, java, javascript, ruby, perl, python and lisp),
has definitely not hurt me in terms of
making the transition from VB6 to .Net (including both VB.Net and C#.Net).

I wouldn't discourage anyone who wanted to explore the possibilities of WPF,
but if I had to choose a starter language (and IDE) for someone who had totally never programmed before
I would (without hesitation or reservation) choose VB6.

I have taught hundreds of people to program using VB6
and (you can believe this or not) I can basically tell within three training sessions
how successful they are going to be with programming in general
(including whether it's worth my time to go on with them toward .Net,
WPF or even introduce them to "hard core" programming in C/C++).

Here's my usual 3 starter VB6 lessons:
Lesson one - hello world with button click and text/label output (builds confidence, gets them used to using an IDE)
Lesson two - fill picbox with random pixels and drag picbox (with bmp image loaded from file),
across a gradient form background
(text only projects are generally considered to be "boring" and "no fun" by students, so..)
Lesson three - simple database ad-hoc queries (this is usually the lesson
that trips up people who have trouble with logical thinking..)

If I were going from VB6 straight to wpf/xaml then
lesson 4 in VB6 would working with XML/Sax in a treeview control and parsing a xaml file.
Then onto working with grid and canvas elements in WPF.

Of course jumping past .Net (in going directly from VB6 to WPF)
might be cheating the person
who could learn a whole lot from a bunch of Winforms lessons,
that might include having discussions about OOP, multi-core threading, and design patterns.

Granted these lessons and topics could be discussed
using WPF context but personally I would feel more comfortable
using Winforms code examples rather than XAML coded examples.

As regarding "limiting horizons.."
About 10% of the people I have taught are natural born programmers.
There brains are wired in such a way they just "get" things,
and there is almost nothing I have to do to stimulate logical thinking.

With these people the "How to write code" lessons go pretty quickly into discussions
about making a higher order application structuring and design decisions.
These people are a true pleasure to watch grow and flourish.

There is another 10-15% on the other end of the spectrum that not only
doesn't understand the code that is taught to them
but who struggle with even with the thought processes that are needed to
appreciate the basic concepts behind programming.

Should I just keep saying "you just need to try harder" and watch them
get increasingly frustrated --that would be cruel.

A lot of them are "free form" thinkers who can do other
things on the computer that are
more attuned to their creative and imaginative abilities - making up graphics,
working with midi instruments, shooting video, etc.
Some of them might be talented enough to even go on to
being part of production teams for video games or cartoon animations.

The other 60-65% in the middle - maybe it's to their advantage
to bypass VB6/.Net and be taught generating WPF/XAML code using the designer.
Some of them might pick up how to hand tweak the XAML code as well.

Then maybe, if at some point in the future, if a few of them have to work with "wpf-like" programming
in some job position that doesn't have the title of "programmer" or "developer"
they'll at least be able to work at a boss-assigned project and "muddle though" somehow.

In any case answering threads (where you know the original poster is using WinForms),
with a post that essentially says,
"I'm not going to help you with your WinForms question
because WPF can do it easier" just doesn't seem..well..very "thread task focused"?

Others who provide WinForms-oriented reply posts in such a thread
usually end up providing a successful Winforms answer
to the original Winforms question.

At which point the original thread starter
then usually just seems to mentally bypass any
WPF posts they seem to consider non-sequiturs.

So who (in the end) is benefited from a WPF post
in a thread that started with a WinForms question?

Is the thinking that:
people who find the thread later
(probably looking for some Winforms-based code solution),
are somehow are "magically" converted to WPF,
gleefully abandoning the 95% of the WinForms app code they have already written
to start over with writing WPF/Xaml code?

I know you, AW, probably find it very frustrating that
there just aren't enough WPF/XAML questions
..and that your WPF/XAML expertise isn't really called on enough,
but we do appreciate when you post to share your advanced
knowledge of .Net WinForm coding techniques as well.

Last edited by hDC_0; 09-02-2012 at 05:45 PM.
Reply With Quote
  #18  
Old 09-03-2012, 07:38 AM
AtmaWeapon's Avatar
AtmaWeaponlabel backcolor set to 'transparent' not working AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,500
Default

Programming is about choosing the right tool for the job. A machete can be used to cut 2x4s, but a table saw is preferred. You can bore holes with a screwdriver, but a drill provides superior results.

I've seen questions of this form before:
Quote:
I have a few hundred records in an XML file that I need to search and sort, and 8 users need to be able to edit it in time. Searching is slow, and so is sorting, and I keep having problems where when one user edits the file at the same time as another one of the edits doesn't get saved. How do I implement code to make this faster and more robust?
Time and again, the answer from us is, "You should really use a database, they're designed for it." It's not a non-sequitur, it's suggesting that a tile cutter be used to cut tile.

I'm not saying OP should use WPF because I have an itch to scratch. I'm mentioning WPF in every GDI+ thread about transparency because there's 2-3 pages of gotchas surrounding transparency in GDI+. It's a topic I attacked with vigor in the past and spent at least 8 hours of my free time at home experimenting with tons of different hacks to get it working. In WPF you set a property and it works. I don't want to spend another minute writing GDI+ hacks for transparency.

Your points are well thought-out and valid, but in the past two or three months I've only seen one other user mention "this is easier in WPF" after explaining the framework of a GDI+ example that would take a couple of hours to write.
I'd love to respond to more questions with a WPF example but it's disheartening to do so and be ignored or get an unintentionally malicious response like, "Yeah but how do you do it with Windows Forms?" At work these days I barely have enough time to respond to one thread per day properly, so I pick the fastest answer which is more often than not WPF.

I'm very frustrated that I didn't get to explore WPF alongside forum members like I did with Windows Forms. I learned WinForms in a hurry by answering questions I didn't know how to answer. Literally no one seems interested in WPF. I've seen maybe 3 questions concerning it, and if I respond to a question with a WPF implementation it's treated like a leper.

Now, if the tone in here feels a little adversarial it's mostly my fault.So have a pony to lighten the mood. I'm done being off-topic now that I've vented my steam.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #19  
Old 09-03-2012, 04:52 PM
hDC_0label backcolor set to 'transparent' not working hDC_0 is offline
Contributor

* Expert *
 
Join Date: Feb 2004
Posts: 559
Default pony gratitude

Quote:
Originally Posted by AtmaWeapon
Your points are well thought-out and valid..
Yes, I also was not trying to be "adversarial".

Thanks for sharing a larger size version of your pony avatar!
Reply With Quote
  #20  
Old 09-04-2012, 04:49 PM
Gruff's Avatar
Grufflabel backcolor set to 'transparent' not working Gruff is offline
Bald Mountain Survivor

Retired Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA - deceased
Posts: 6,440
Default

Personally I would have loved to have a WPF area where we could all learn
together as I have several thousand questions about it.
It's the concepts that I find difficult.
I lobbied for such an area but was shot down.
Perhaps we can revisit the question with the Admins.
__________________
Burn the land and boil the sea
You can't take the sky from me


~T
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
label backcolor set to 'transparent' not working
label backcolor set to 'transparent' not working
label backcolor set to 'transparent' not working label backcolor set to 'transparent' not working
label backcolor set to 'transparent' not working
label backcolor set to 'transparent' not working
label backcolor set to 'transparent' not working label backcolor set to 'transparent' not working label backcolor set to 'transparent' not working label backcolor set to 'transparent' not working label backcolor set to 'transparent' not working label backcolor set to 'transparent' not working label backcolor set to 'transparent' not working
label backcolor set to 'transparent' not working
label backcolor set to 'transparent' not working
 
label backcolor set to 'transparent' not working
label backcolor set to 'transparent' not working
 
-->