Style ListBox Scrollbar?

Get help using Construct 2

Post » Mon Sep 26, 2016 7:22 pm

Dear Knowledgeable Construct 2 Programmer,

How Can I Style a Scrollbar of a ListBox Object?

The ListBox object does allow css to be passed in. I do not know what i should type in to style the scrollbar though.

I have tried to do that by using “set css style” and I typed in the following:

Set scrollbar-face-color to #000000;
Set scrollbar-shadow-color to #2D2C4D;
Set scrollbar-highlight-color to #7D7E94;
Set scrollbar-3dlight-color to #7D7E94;
Set scrollbar-darkshadow-color to #2D2C4D;
Set scrollbar-track-color to #7D7E94;
Set scrollbar-arrow-color to #C1C1D1;

None of the above seem to work.

Please note that I have successfully managed to centre the list box items and I changed their font as well. However I cannot do anything to the scrollbar, which looks so dull…

My second part of question is the following: how can I hide it if I ever need to?

Would all the styles be preserved if I export my game to mobile?

Thank you in advance!
B
13
S
2
G
1
Posts: 50
Reputation: 1,233

Post » Mon Sep 26, 2016 8:10 pm

B
17
S
7
G
7
Posts: 205
Reputation: 5,335

Post » Tue Sep 27, 2016 12:23 am

Thank you for your reply,

I had read that article rather carefully before i posted my question. There is no answer regarding styling the scrollbar. I either miss some detail or you had not read my question carefully enough. Thank you for your contribution anyway.

If i do miss something important in that article, specify the detail that might push me forward. Otherwise read my question again and have a second shot at helping. I strongly encourage you to do so!
B
13
S
2
G
1
Posts: 50
Reputation: 1,233

Post » Tue Sep 27, 2016 4:16 pm

where use the list? it is so important ? you can use other method.. i told you cause with all my experience with listbox i find it this method useless.. i dont know what you have in your mind ;) but feel free to tell us what exactly you need meaby we find you other method
B
17
S
7
G
7
Posts: 205
Reputation: 5,335

Post » Wed Sep 28, 2016 12:20 am

Thank you for coming back to me, i really appreciate it!

What i have built is the following:

0. I have a textbox where a user types in words (strings).Please note, I never know how many strings the user types in.
1. the strings are added both to an array and i give the user a chance to see what they have already typed in. This is where i use the ListBox to display the list of strings. This choice came to me naturally, because there is a scrollbar built in, which makes it easy to browse (it is a pity there is no horizontal scrollbar, but i can live with it by extending the list wide enough so that 99% of words fit in), but the problem is i detest the way the vertical scrollbar looks like. I do need it though in case the list is too big, then scrolling is essential to browse the content.
2. the user also has a chance to remove something from the array, which they see in the ListBox.
3. then my game begins.

Therefore i need something that displays my array as a list with easy add/remove method, just to clarify I use only a 1d array. I have everything working the way i want to, expect i cannot tolerate how crude the scrollbar looks. Styling the list items is fine, i cannot do anything to that scrollbar though.

I am open to alternative suggestions. However, the only thing i need is to style that "bloody" scrollbar. If something is not completely clear for any possible reason, i can post my capx shortly as i am now crushing out.

Looking forward to your reply!
B
13
S
2
G
1
Posts: 50
Reputation: 1,233

Post » Wed Sep 28, 2016 2:11 am

you can send capx. use link here
B
17
S
7
G
7
Posts: 205
Reputation: 5,335

Post » Wed Sep 28, 2016 4:35 am

Try using this editor to create a css config table, then use the technique the tutorial in my signature to set it (using a text object). I can't try it now but i think this should work for you.
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,245
Reputation: 46,464

Post » Thu Sep 29, 2016 10:38 pm

Thank you for showing me a direction. It seems like a way up through the "rectum" up to the stomach instead of the easy way. I am glad there is a solution though.

BTW, if you want to see what i have been up to, take a look and perhaps do contribute to my new post closely related to the above one. Unfortunately, i have encountered a much more complicated problem than just styling :/

scirra.com/forum/make-a-cumulative-local-storage-sessions_t182451
B
13
S
2
G
1
Posts: 50
Reputation: 1,233


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 39 guests