Hi All,
I am using the following code to change the property of the form and its controls from left to right and vice versa, the problem is with the following
1. the comboboxe do not change its scrollbar from left to right.
2. the form caption still remains to left or the right of the form.
3. the optiongroup do not seem to be affected in any way.
4. finally the code is affecting the menu I am using.
The whole idea is to come up with a bilingual interface as the user may need.
I am looking for productive suggestions to workaround this problem with afinal solution.
This is the code I am using.
'******************************************************************************************
'changes display UI for all controls on a form
'******************************************************************************************
Public Sub LocForm(oFrm As Form)
On Error GoTo PROC_ERR
' oFrm.Orientation = 0
oFrm.Caption = oFrm.Tag
For Each Ctl In oFrm.Controls
' Swithch View
If TypeOf Ctl Is Label _
Or TypeOf Ctl Is TextBox _
Or TypeOf Ctl Is SubForm _
Or TypeOf Ctl Is ComboBox _
Or TypeOf Ctl Is ListBox _
Or TypeOf Ctl Is CommandButton _
Or TypeOf Ctl Is CheckBox _
Or TypeOf Ctl Is Calendar _
Or TypeOf Ctl Is Control _
Or TypeOf Ctl Is Controls _
Or TypeOf Ctl Is OptionButton _
Or TypeOf Ctl Is OptionGroup Then
Ctl.Left = oFrm.Width - (Ctl.Left + Ctl.Width)
End If
' Switch Captions
If TypeOf Ctl Is Label Or TypeOf Ctl Is Page _
Or TypeOf Ctl Is CommandBars Then
Ctl.Caption = Ctl.Tag
End If
' Switch Reading Orders
If TypeOf Ctl Is Label _
Or TypeOf Ctl Is TextBox _
Or TypeOf Ctl Is ComboBox Then
If Ctl.TextAlign = 3 Then Ctl.TextAlign = 1
End If
' Switch Scroll Bar Allign
If TypeOf Ctl Is ComboBox Or TypeOf Ctl Is ListBox Then
Ctl.ScrollBarAlign = 2
End If
Next
Set cbm = CommandBars("mnuForm")
Set cbc = CommandBars("mnuForm").Controls
For Each ctl In cbc
ctl.Caption = ctl.Tag
Next
PROC_EXIT:
Exit Sub
PROC_ERR:
MsgBox Err.Description
Resume PROC_EXIT
End Sub
Thank you & regards,
Khalid Arramli
I am using the following code to change the property of the form and its controls from left to right and vice versa, the problem is with the following
1. the comboboxe do not change its scrollbar from left to right.
2. the form caption still remains to left or the right of the form.
3. the optiongroup do not seem to be affected in any way.
4. finally the code is affecting the menu I am using.
The whole idea is to come up with a bilingual interface as the user may need.
I am looking for productive suggestions to workaround this problem with afinal solution.
This is the code I am using.
'******************************************************************************************
'changes display UI for all controls on a form
'******************************************************************************************
Public Sub LocForm(oFrm As Form)
On Error GoTo PROC_ERR
' oFrm.Orientation = 0
oFrm.Caption = oFrm.Tag
For Each Ctl In oFrm.Controls
' Swithch View
If TypeOf Ctl Is Label _
Or TypeOf Ctl Is TextBox _
Or TypeOf Ctl Is SubForm _
Or TypeOf Ctl Is ComboBox _
Or TypeOf Ctl Is ListBox _
Or TypeOf Ctl Is CommandButton _
Or TypeOf Ctl Is CheckBox _
Or TypeOf Ctl Is Calendar _
Or TypeOf Ctl Is Control _
Or TypeOf Ctl Is Controls _
Or TypeOf Ctl Is OptionButton _
Or TypeOf Ctl Is OptionGroup Then
Ctl.Left = oFrm.Width - (Ctl.Left + Ctl.Width)
End If
' Switch Captions
If TypeOf Ctl Is Label Or TypeOf Ctl Is Page _
Or TypeOf Ctl Is CommandBars Then
Ctl.Caption = Ctl.Tag
End If
' Switch Reading Orders
If TypeOf Ctl Is Label _
Or TypeOf Ctl Is TextBox _
Or TypeOf Ctl Is ComboBox Then
If Ctl.TextAlign = 3 Then Ctl.TextAlign = 1
End If
' Switch Scroll Bar Allign
If TypeOf Ctl Is ComboBox Or TypeOf Ctl Is ListBox Then
Ctl.ScrollBarAlign = 2
End If
Next
Set cbm = CommandBars("mnuForm")
Set cbc = CommandBars("mnuForm").Controls
For Each ctl In cbc
ctl.Caption = ctl.Tag
Next
PROC_EXIT:
Exit Sub
PROC_ERR:
MsgBox Err.Description
Resume PROC_EXIT
End Sub
Thank you & regards,
Khalid Arramli