.NET GUI Quirks - By Design?

  • Thread starter Thread starter shalomshachne
  • Start date Start date
S

shalomshachne

Hi -

As I've delved more into programming forms in C#, I'm seeing some
weird things, which don't (to me) make any sense. As I've Googled
around on these, it seems like the responses are saying these are "by
design". (My experience has been in .NET 2.0, so if these issues are
gone in the newer releases - then I'm just behind the times.)

Hoping to find some wisdom to help correct my concept of how the
design should be, so maybe future quirks will be more intuitive to
me. Any insight will be greatly appreciated...

1. Tooltips: Autopop property has hidden undocumented limit. No
matter how high you set the value, tool tip will disappear after
around 30 seconds. Does that make sense? Also, once Autopop time has
expired, returning mouse over control does not redisplay the tool
tip. I've seen work around code based on resetting tool tip by
handling Mouse Over/Out events. Do we all need to write handling code
to get a sane tool tip behavior? (Looking for a reality check
here...)


2. DataGridView.SelectedRows: for some reason, they decided that the
order of rows in the DataGridViewRowSelectedRowsCollection should be
the reverse order of how they are displayed in the grid. This seems
highly unintuitive for the user (if they are seeing things changed as
they add more rows to selection). Is there a rationale for this that
I am missing?


Anyway, maybe someone with deeper insight than I have can explain
these (and other quirks). And I apologize if this group is not the
right forum/context to post this message.

All the best to everyone struggling with GUI programming...

Sam
 
Hi -

As I've delved more into programming forms in C#, I'm seeing some
weird things, which don't (to me) make any sense. As I've Googled
around on these, it seems like the responses are saying these are "by
design". (My experience has been in .NET 2.0, so if these issues are
gone in the newer releases - then I'm just behind the times.)

Hoping to find some wisdom to help correct my concept of how the
design should be, so maybe future quirks will be more intuitive to
me. Any insight will be greatly appreciated...

1. Tooltips: Autopop property has hidden undocumented limit. No
matter how high you set the value, tool tip will disappear after
around 30 seconds. Does that make sense?
The AutoPopupDelay property determines the length of time the ToolTip
window remains visible if the pointer is stationary inside a ToolTip
region. The ToolTip will be dismissed when the mouse moves or the
AutoPopupDelay expires, which ever comes first.
Also, once Autopop time has
expired, returning mouse over control does not redisplay the tool
tip. I've seen work around code based on resetting tool tip by
handling Mouse Over/Out events. Do we all need to write handling code
to get a sane tool tip behavior? (Looking for a reality check
here...)
ToolTips only appear when the cursor is stationary within the ToolTip
region. Check the ReshowDelay property, if the cursor moves before
this value expires the ToolTip will not be displayed.

regards
A.G.
 
1. I cannot imagine wanting a tooltip to stay lit for that long, but
apparently the way to do this is with the StopTimer method. It is protected
so you need to create your own "InfiniteToolTip" class that inherits from
ToolTip.

2. No clue on this, but if the documentation doesn't say sorted, don't
assume it will be sorted...
 
The AutoPopupDelay property determines the length of time the ToolTip
window remains visible if the pointer is stationary inside a ToolTip
region. The ToolTip will be dismissed when the mouse moves or the
AutoPopupDelay expires, which ever comes first.


ToolTips only appear when the cursor is stationary within the ToolTip
region. Check the ReshowDelay property, if the cursor moves before
this value expires the ToolTip will not be displayed.

regards
A.G.

Hi A.G. --

Thanks for your response. Actually I tested all the combinations of
of parameters and found that nothing will make it come back.
After a bunch of Googling I saw that a few others reported same
issue. ReshowDelay only affects how long it waits to display next
toolTip on different control, when current tooltip is still
displayed. At some point, someone said they found documentation that
this behavior was by design.

See:

http://www.windows-studio.com/3/cfbc950d5240ae8b.php
 
1. I cannot imagine wanting a tooltip to stay lit for that long, but
apparently the way to do this is with the StopTimer method. It is protected
so you need to create your own "InfiniteToolTip" class that inherits from
ToolTip.

-- to my thinking, Tooltip should be able to stay visible as long as
user hovers over the area. Hover over something in Visual Studio.
You will see that the Tooltip never disappears. I think that's what
users expect. If you have very short text, however, I agree there is
no need to make it always visible.

But the main issue, is that if you hover over the area until ToolTip
disappears, you'll never see that ToolTip again (Try it.). Can you
explain why that makes sense?

I did create my own ToolTip subclass. Just seems wasteful to need to
do that.
 
Shalom Shachne said:
-- to my thinking, Tooltip should be able to stay visible as long as
user hovers over the area. Hover over something in Visual Studio.
You will see that the Tooltip never disappears. I think that's what
users expect. If you have very short text, however, I agree there is
no need to make it always visible.

I don't know -- I'd be of two minds about it, one that makes sense, and
two, it might be annoying to have a tooltip hiding something else
because the mouse is over a control.
But the main issue, is that if you hover over the area until ToolTip
disappears, you'll never see that ToolTip again (Try it.). Can you
explain why that makes sense?

Sorta...

If you move the mouse over another control and then back over the one
that is no longer displaying, it will reappear.

So, I'd guess the logic was that if it's been displayed long enough to
be hidden, then the user will remember it -- at least until after
they've needed to be told about something else.
I did create my own ToolTip subclass. Just seems wasteful to need to
do that.

Yeah. I'd expect the property that controls how long it will display,
to display it that long...
 
I don't know -- I'd be of two minds about it, one that makes sense, and
two, it might be annoying to have a tooltip hiding something else
because the mouse is over a control.


Sorta...

If you move the mouse over another control and then back over the one
that is no longer displaying, it will reappear.

So, I'd guess the logic was that if it's been displayed long enough to
be hidden, then the user will remember it -- at least until after
they've needed to be told about something else.


Yeah. I'd expect the property that controls how long it will display,
to display it that long...

Responding to this point:
So, I'd guess the logic was that if it's been displayed long enough to
be hidden, then the user will remember it -- at least until after
they've needed to be told about something else.

Here's the thing, if that were actually true, then it would be fine.
But the tool tip will NEVER reappear, ever again, no matter what you
do after it disapears (except if you restart the app.) Try it:

1. Create a form with 2 buttons.
2. Put a tool tip on both buttons.
3. Hover over button1 until tool tip disappears.
4. Hover over button2 - and then hover over button1 again. You won't
see the tool tip. and there's nothing you can do to bring it back.
Nothing....

:)


(I'd post the test form I made, but I don't see any way to attach
files to a post...)



What's funny is the how many responses I've seen to this where people
tell me the tool tip will come back if you just do X, Y, or Z.
Actually, no one tried any of their own suggestions, because I can
tell you, after looking into it for quite a while - it just doesn't
come back, no matter what you do. (Except if you subclass the control
like I did, what a waste.)

I think the bane of a programmer's existence are hidden, poorly (or
not at all) documented behaviors that the designers thought made
sense. Give the programmers the control, make the properties do what
they say, and let us decide what is good or not good for users...

Thanks for your comments - let me know if I'm way off base here...
 
-snip-
Here's the thing, if that were actually true, then it would be fine.
But the tool tip will NEVER reappear, ever again, no matter what you
do after it disapears (except if you restart the app.) Try it:

1. Create a form with 2 buttons.
2. Put a tool tip on both buttons.
3. Hover over button1 until tool tip disappears.
4. Hover over button2 - and then hover over button1 again. You won't
see the tool tip. and there's nothing you can do to bring it back.
Nothing....

:)


(I'd post the test form I made, but I don't see any way to attach
files to a post...)



What's funny is the how many responses I've seen to this where people
tell me the tool tip will come back if you just do X, Y, or Z.
Actually, no one tried any of their own suggestions, because I can
tell you, after looking into it for quite a while - it just doesn't
come back, no matter what you do. (Except if you subclass the control
like I did, what a waste.)

Well, I *DID* try it, and although you shouldn't attach files to post
to text newsgroups, there's nothing wrong with including a lot of
text....so here's my code (the tip displays for ~30 seconds and then
disappears just like you said, move the mouse to the 2nd label and
*it's* tip shows and so will the 1st one's).



Public Class Form1
Inherits System.Windows.Forms.Form
Public Sub New()
InitializeComponent()

ToolTip1.AutoPopDelay = 6000 * 300

End Sub


'Form overrides dispose to clean up the component list.
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.SuspendLayout()
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(35, 44)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(39, 13)
Me.Label1.TabIndex = 0
Me.Label1.Text = "Label1"
Me.ToolTip1.SetToolTip(Me.Label1, "Label1")
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(116, 44)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(39, 13)
Me.Label2.TabIndex = 1
Me.Label2.Text = "Label2"
Me.ToolTip1.SetToolTip(Me.Label2, "Label2")
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
Me.PerformLayout()

End Sub
Friend WithEvents ToolTip1 As System.Windows.Forms.ToolTip
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label


End Class
 
-snip-
Public Class Form1
Inherits System.Windows.Forms.Form
Public Sub New()
InitializeComponent()

ToolTip1.AutoPopDelay = 6000 * 300

End Sub

To anyone that cares -- sorry for the VB, I switch back and forth all
day, and that's what I used last. I tested it with C# as well, no
difference (not that I expected one) I also used VS2005 and VS2008 and
framework 2.0 and 3.5
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top