Overlay Controls (3 Viewers)

tvanstiphout

Well-known member
Local time
Yesterday, 20:50
Joined
Jan 22, 2016
Messages
653
In a Continuous form, if we want to change the RowSource of a combobox for each row, we can overlay that combobox with a textbox. An example is implemented in NW2-Dev, Order form, Order Line Items subform, the Product section. The textbox shows the value for the non-current rows, and the combobox is for picking a product from the list which is restricted to the selected category. That works fine.

In my app I'm trying to do something similar: an editor control (textbox txtDataEntryAssist) bound to a helper field of the right data type. The actual value for the non-current rows is in the overlay textbox control theValue. I temporarily am setting the background of the helper controls to faint blue so I can easily tell the difference.
The kicker is that I have TWO helper controls. One to set the Sign, and one to enter the value. It is common practice with chemical analyses to say "less than detection limit" if there is so little of an analyte in the sample that the machinery cannot detect it. In the attached database this is the case for the 3 trace elements Al, Sb, and Ar.

This is a WIP, and for example there is no code yet to resize the data entry fields for cases where the Sign field makes no sense (e.g. Manufacturing Date), or to set the Format property for Percent fields. None of that is relevant to the issue at hand.
One way to see the desired effect is to design the form and drag theValue below the data entry fields.

So the question is: how can I show both data entry fields for the current row.
 

Attachments

I do not think you will be able to do that. Only one can have the focus and thus only one can be in front of the value control. However I do not really see how this "assists" anything except for providing date fields with a date picker. If not it simply enforces rules. If I was doing this I think I would ditch that idea. I would simply provide the value field but validate the data by rolling my own validation rule on the before insert.

If the datatype is text then anything goes
if int I validate that the portion after the symbol is an integer and that the portion before the integer is a valid symbol (<, >, etc.)
If floating point the same type of validation but it can have a symbol followed by digits, decimal point, digits
The only trick is on dates. In this case I would roll my own calendar control and make that available with a mouse click or down arrow.
 
you can house the "sign" and "txtDataEntryAssist" textboxes to a separate pop-up form (borderless) and just pop up the form when TheValue gotfocused/or got clicked.
or you can assign special key to show the pop-up form.
you might need Pavlo Pendan's clsControlLayout cls, to corectly place the pop-up form to the coordinate of TheValue field.
 

Users who are viewing this thread

Back
Top Bottom