How to make Tabhost pretty(Beutiful)

Theera

Well-Known Member
Licensed User
Hi all,
If I have tabhost 10 tabs,the widget will devide for 10 tabs. If I have tabhost n tabs,the widget will devide for n tabs. Is there method to fit and slide instead.

P.S.
I'm not good at English

Best Regards
Theera
 
Last edited:

Theera

Well-Known Member
Licensed User
As already suggested here, why don't you use corwin42s' AHViewerPage library ?

Best regards.

Hi Klaus,
I don't forget your advise ,but the helpdesk program which you help me is more useful. I can apply more. example I can apply about using as inventory,using as doctor's tools,etc.
However,I need to apply more to using as saleman's tools,if I add edittext and two buttons suffix the question as picture belows.

Best Regards
Theera
 
Last edited:
Upvote 0

Theera

Well-Known Member
Licensed User
Please help me correct this code

Hi Klaus,
I have modified helpdsk3 to be helpdsk4 again. I have addition follow as picture shown before.But I don't to change each edittext of questions.
My code is belows

P.S. Change to learn more myself.

Best Regards
Theera
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Following problems:
- You define an Eventname as ClickAdditionSign but for the event you use AdditionSign_Click !?
- in the ReduceSign_Click and AdditionSign_Click routines you were mixing up lots of things.

Attached the modyfied version. Comments are in the code.

Best regards.
 

Attachments

  • HelpDsk4_1.zip
    10.9 KB · Views: 150
Upvote 0

Theera

Well-Known Member
Licensed User
Following problems:
- You define an Eventname as ClickAdditionSign but for the event you use AdditionSign_Click !?
- in the ReduceSign_Click and AdditionSign_Click routines you were mixing up lots of things.

Attached the modyfied version. Comments are in the code.

Best regards.

Hi Klaus,
If I want edittext,and 2 buttons enabled after chkbox is true ,I must use timer to check it or have another way better than ?

Best Regards
Theera
 
Upvote 0

klaus

Expert
Licensed User
Why would you use a timer ?
You should use the CheckBox_CheckedChange event.
I wouldn't set the Enabled property but the Visible property.
I prefer letting see the user only what he is authorized to do I find playing with Enabled more confusing. But this is personal feeling.
In the attached version you have both in.

Best regards.
 

Attachments

  • HelpDsk4_3.zip
    11 KB · Views: 116
Upvote 0

Theera

Well-Known Member
Licensed User
For..next Loop make me terrible.

Hi Klaus,
I'm terrible about line 407 from Helpdsk5.b4a I don't know to manage this code
Amt=Amt+NumberFormat(strAdd,0,2)
Thank you very much for your kind.

P.S. This widget make me learn below.
1.Encoding UTF-8 without BOM
2.Using Corwin42 's Ahviewer and Scrollview programming
3.Using design layout runtime and using dip design for vary screen.
4.Learning high technique programming
5.Friendship in B4A Forum.

Best Regards
Theera
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
What exactly do you want to do ?
You dim Amt as an integer number.
Then you try to add to an integer number a string, this doesn't work.
The NumberFormat keyword returns a string !
If you need numbers you must use numbers.
When you want to display numbers in a given format then you should use NumberFormat.
For me it's not good practice to mix string variables with number variables when you want to make calculations even though sometimes it works.

Best regards.
 
Upvote 0

Theera

Well-Known Member
Licensed User
What exactly do you want to do ?
You dim Amt as an integer number.
Then you try to add to an integer number a string, this doesn't work.
The NumberFormat keyword returns a string !
If you need numbers you must use numbers.
When you want to display numbers in a given format then you should use NumberFormat.
For me it's not good practice to mix string variables with number variables when you want to make calculations even though sometimes it works.

Best regards.

Hi Klaus,
I'm sorry. I'm stupid myself. I must lay this code: amt =amt+NumberFormat(strAdd,0,2) within If chk.Checked = True then ...End If ,and Change Dim strAdd as String to be Dim strAdd as int
P.S. I ought use word "Total" instead of word "strAdd" for understand
Best Regards
Theera
 
Last edited:
Upvote 0

Theera

Well-Known Member
Licensed User
Have something be wrong

Hi Klaus,
After I finished the old problem,I try to test again.I try to check box within the first tab,it works,after then press AnswerOK, change another tab and check box within the second tab,it has error occurred.I can not to continue this problem belows:

Best Regards
Theera
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Here you are.
The problem was here line 393 txt = txt & lstQ.Get(i) it must txt = txt & lstQ.Get(i/4).

The previous problem still remained.
The problem is here line 402 TargerStr = Regex.Split(" ", str(0)).
Your data seems not beeing consistent the numeric value you try to extract is either in TargerStr(1) or in TargerStr(2).
I added a test to check it, but I'm not sure if it was you want.

Best regards.
 

Attachments

  • helpdsk5_2.zip
    11.5 KB · Views: 116
Upvote 0

Theera

Well-Known Member
Licensed User
Many Thank,Klaus

Hi Klaus,
Thank you very much to make it completely.I will study your this code again and again.I wish hope to be a half of good at your programming. I apologize you to make you terribled.

Best Ragards
Theera
 
Upvote 0
Top