Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Control focus on a complex GUI. (Windows Forms - NetFrameWork 4.0)

$
0
0

Hi,

I have worked few days to fix my problems... and I'm going nowhere.

So, I Need help:

I have o complex Windows Form Application which build dynamic the GUI, from an xml file.

The structure of GUI is very complicated:

A MainForm which contain a splitcontainer

In Panel2 of SplitContainer I have an UserControl =a frame for opened forms inside to app

On each GUI form ai have an complex usercontrol which contain:

a splitcontainer with a DataGridView (ReadOnly) in left and TableLayoutPanel in right

In TableLayoutPanel I have one or more panels (called groups).

In each panel I have

two panels - one with a title, and one with another TableLayoutPanel which contain the controls for editing current record .

The GUI form can have a header and one or more details each zone (header,details) contain same structure: a grid and controls for editings current record, in the structure described .

So, I need to control the flow to next control with tab.:

When the focus is on the last control , next forward tab to select first control in same level (header, or details)

Each control for editing record Inherit a class fieldTemplate

I tried to override ProcessTabKey in Group container:

protected override bool ProcessTabKey( bool forward )
{
if (ActiveControl == null ) return base.ProcessTabKey(forward);
if (!forward && ((fieldTemplate)ActiveControl).IsFirst)
{
lastControl.Select();
return true;
}
if (forward && ActiveControl == lastControl)
{
firstControl.Select();
return true;
}
return base.ProcessTabKey(forward);
}

lastControl - is last control from current zone

firstControl - first editing control in current zone.

Is not working.

I also tried to implement ProcessTabKey on each container which accept this method. No good result.

I think i hard to understand the structure of inheritance of controls.

If I can upload o a screen capture will be simple to understand.

The code is very large and complex...




Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>