Free cookie consent management tool by TermsFeed Policy Generator

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#1052 closed defect (rejected)

Textboxes are not validated after clicking in a control's background

Reported by: abeham Owned by: abeham
Priority: lowest Milestone: HeuristicLab 3.3.0
Component: MainForm.WindowsForms Version: 3.3
Keywords: Cc:

Description

It would be nice to have textboxes validating upon clicking "anywhere else". Currently you have to find another control that accepts focus.

Attachments (1)

WinFormsFocusTest.zip (11.4 KB) - added by abeham 14 years ago.
Test project

Download all attachments as: .zip

Change History (7)

comment:1 Changed 14 years ago by abeham

  • Status changed from new to assigned

I'm going to try this on a demo project

comment:2 Changed 14 years ago by abeham

I played around for a while, but without success. I have found a similar question at stackoverflow, where the answer was "UserControl will fight you tooth and nail to avoid getting the focus."

The problem is easily reproduced by creating an empty Form and adding a sole TextBox. The event handler on the Validated event of the TextBox fires only upon closing the form. There's no other possibility to validate the TextBox (the box as dragged in from the toolbox didn't even validate on pressing Return or Enter).

This "bug" also has a consequence: When you edit the value of a parameter, click the save toolbar item and save the currently active item, it will not save the item with the parameter value that was just entered, but with the old one. The TextBox does not lose focus when a toolbar item is clicked.

To be fair though this has not yet been an issue (and is probably there since 1.1). It seems to be pretty complicated to achieve validation on "anywhere-click". The other solution would be to always provide a second control to validate the input like a button, but I'm not a big fan of this either.

Maybe we can at least fix the bug somehow by calling Validate() on the form before performing an action in a toolbar- or menu item, don't know yet if that will work.

:-/

Changed 14 years ago by abeham

Test project

comment:3 Changed 14 years ago by swagner

Thanks abeham for your effort on this issue.

However, to be honest, I would recommend to leave this behavior as it is. It is definitively there since the first version of HL and I don't think that we had any severe difficulties because of it so far.

comment:4 Changed 14 years ago by abeham

  • Resolution set to wontfix
  • Status changed from assigned to closed

comment:5 Changed 14 years ago by swagner

  • Milestone changed from Iteration 4 to Current

Milestone Iteration 4 deleted

comment:11 Changed 14 years ago by swagner

  • Milestone changed from Current to HeuristicLab 3.3.0

Milestone Current deleted

Note: See TracTickets for help on using tickets.