![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I know how to change the tab order of controls in the designer (send to back), but I have an application with some runtime generated controls.
Interestingly, the tab order is just the reverse of the generation order, which is slightly annoying (it would mean to use a For/Next Loop with STEP - 1 to get it all in the right order ;-) Therefore it would be very nice to be able to manipulate the tab order differently. Is this possible? |
|
||||
|
You can use the lostfocus event to make the next control gain focus in the order you want...
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
||||
|
I don't really understand you'r comment...
You say it's a nice idea, but a bit like shooting yourself in the foot, why? it gets the job done... Another way is to edit the spb file and invert the order of the control-creators code...
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing |
|
|||
|
Simple: Setting Focus according to tab order is something that can be handled perfectly well by the Framework (CF) or the Operating System (Windows [Mobile]).
Also, it should be done this way. Faking (overriding) a tab order by catching events is something only real programmers do. Have a look at this http://www.pbm.com/~lindahl/real.programmers.htmlProbably you understand why I think this is shooting yourself into the foot. Hopefully, you haven't been offended by my answer. PS: Feels also a little bit like back in the good old VIC 20 times. ![]() |
|
||||
|
Quote:
PS: TRS80-Model 1's set me off. - My brother was into Commodore Pets. Those machines set off the Motorola approach vs the Intel approach schism that persists in some form to this very day. |
|
||||
|
I finally got around to trying the solution I suggested (placing the names of the controls in an arrayList, running through the list, and using .bringToFront to set the tab order).
The form this is called from contains a control called 'arrayFormMedsTabOrder'. Here's the relevant code: Code:
sub formMeds_Show ... arrayFormMedsTabOrder.Add( "formMedsHeader" ) arrayFormMedsTabOrder.Add( "labelMedsNDC" ) arrayFormMedsTabOrder.Add( "textMedsNDCLabeler" ) arrayFormMedsTabOrder.Add( "labelMedsNDCSep" ) arrayFormMedsTabOrder.Add( "textMedsNDCProduct" ) arrayFormMedsTabOrder.Add( "labelMedsProduct" ) arrayFormMedsTabOrder.Add( "textMedsProduct" ) arrayFormMedsTabOrder.Add( "btnMedsSearch" ) arrayFormMedsTabOrder.Add( "labelMedsGeneric" ) arrayFormMedsTabOrder.Add( "textMedsGeneric" ) arrayFormMedsTabOrder.Add( "btnMedsClear" ) arrayFormMedsTabOrder.Add( "labelMedsDose" ) arrayFormMedsTabOrder.Add( "textMedsDose" ) arrayFormMedsTabOrder.Add( "labelMedsRoute" ) arrayFormMedsTabOrder.Add( "comboMedsRoute" ) arrayFormMedsTabOrder.Add( "labelMedsFrequency" ) arrayFormMedsTabOrder.Add( "textMedsFrequency" ) arrayFormMedsTabOrder.Add( "labelMedsDiagnosis" ) arrayFormMedsTabOrder.Add( "textMedsDiagnosis" ) arrayFormMedsTabOrder.Add( "btnMedsDXSearch" ) arrayFormMedsTabOrder.Add( "btnMedsPrev" ) arrayFormMedsTabOrder.Add( "btnMedsNext" ) arrayFormMedsTabOrder.Add( "btnMedsMenu" ) setFormTabOrder( "formMeds" ) ... end sub Code:
Sub setFormTabOrder( pArray ) ctl = "array" & pArray & "TabOrder" For x = 0 To Control( ctl, ArrayList ).Count - 1 Control( Control( ctl, ArrayList ).Item( x ) ).BringToFront Next End Sub Anyone have any ideas? ![]() Gary (I finally have a free weekend, so I'll have to spend some of it dusting off my TRS-80, Atari 2600, or maybe the Exidy Sorcerer... ) ![]() Last edited by willisgt : 01-18-2008 at 05:31 PM. |
|
||||
|
Quote:
|
|
||||
|
I removed all the labels from the list. Changing the code to:
Code:
arrayFormMedsTabOrder.Add( "textMedsNDCLabeler" ) arrayFormMedsTabOrder.Add( "textMedsNDCProduct" ) arrayFormMedsTabOrder.Add( "textMedsProduct" ) arrayFormMedsTabOrder.Add( "btnMedsSearch" ) arrayFormMedsTabOrder.Add( "textMedsGeneric" ) arrayFormMedsTabOrder.Add( "btnMedsClear" ) arrayFormMedsTabOrder.Add( "textMedsDose" ) arrayFormMedsTabOrder.Add( "comboMedsRoute" ) arrayFormMedsTabOrder.Add( "textMedsFrequency" ) arrayFormMedsTabOrder.Add( "textMedsDiagnosis" ) arrayFormMedsTabOrder.Add( "textMedsDiagnosisDesc" ) arrayFormMedsTabOrder.Add( "btnMedsDXSearch" ) arrayFormMedsTabOrder.Add( "btnMedsPrev" ) arrayFormMedsTabOrder.Add( "btnMedsNext" ) arrayFormMedsTabOrder.Add( "btnMedsMenu" ) ![]() The behavior is the same whether I'm just running the code (F5), or a compiled executable. I've got to be missing something really simple here... Gary |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Changing the parent of a panel | Ricky D | Questions & Help Needed | 1 | 10-05-2008 12:03 PM |
| Changing ROW color in Table? | tcgoh | Questions & Help Needed | 0 | 04-07-2008 04:25 PM |
| 'Tab' order of controls | corwinckler | Questions & Help Needed | 1 | 12-18-2007 05:52 AM |
| Changing the size of a form | magi6162 | Questions & Help Needed | 1 | 10-24-2007 08:38 AM |
| Tab Order for Controls | BPak | Questions & Help Needed | 2 | 05-06-2007 06:58 AM |