Text Box with Transparent Background
Thursday, March 31, 2005 by yeldnats | Discussion: DesktopX
I'm a newbie to DesktopX, and really diggin' it! I'm making my first Widget, and have an issue. I am using the DesktopX Edit Control for a text box and would like a transparent background. Does this control support a transparent background? If not, can anyone suggest an ActiveX textbox control that does? I tried using a Layer object that is "Text" type and changing it's text using some OnKeyDown code, but I loose a lot of text box functionality doing this. Any suggestions?
Thanks!
Reply #2 Friday, April 1, 2005 6:48 AM
http://thomthom.wincustomize.com/ViewSkin.aspx?SkinID=3947&LibID=3&comments=1
I expect there might be some issues in certain scenarioes, for instance, I haven't tried it against different odd charactert. But if you try it an find some issues just let me know.
Reply #3 Friday, April 1, 2005 8:07 PM
I wrote a little widget that displays the "key" code as well as the codes for keys that have multiple characters (with shift key depressed) to help me with my other widget. Try it out and observe what you get when typing the keys I mentioned above. Is it just me, or is this odd? BTW, to use it, just click on it and press the key you want the code for...
Link
Thanks,
yeldnats
Reply #4 Friday, April 1, 2005 8:31 PM
(BTW, I made the numbers 3 digits to get them centered better.)
Reply #5 Saturday, April 2, 2005 8:41 AM
Reply #6 Saturday, April 2, 2005 9:32 AM
According the the Wscript docs, the Asc and Chr functions works with ANSI codes.
hmm.. searching info as I type here... http://www.robelle.com/library/smugbook/ansichar.html http://www.alanwood.net/demos/ansi.html
The thing is that I use a Norwegian keyboard here and the layout is slightly different. I have to use [Alt+Gr]+8 to get [, [Alt+Gr]+9 to get ], [Alt+Gr]+7 to get { and [Alt+Gr]+}. These don't work at all in my textbox object. I have to dig deeper to find out what's really going on with the codes beeing sent around here.
Reply #7 Saturday, April 2, 2005 10:35 AM
Right..., you get the euro sign by pressing [Alt Gr]+5 (at least I do with my norwegian keyboard layout), Object_OnChar returns key 8364. If you pass this value to the Chr function you'll get a runtime error. According to the list at http://www.alanwood.net/demos/ansi.html 8364 is the Unicode number for the euro character and the ANSI code is 128.
That means that there is something in the documentation that isn't right.
| If an object has the focus then this function is called when a key is depressed and the ASCII character code is returned in the variable. |
I think DX got Unicode support some versions ago and this might have something about it?
Reply #8 Saturday, April 2, 2005 11:05 AM
btw, I've found a couple of serious bugs in my textbox object. I'll be working on that.
Reply #9 Saturday, April 2, 2005 6:37 PM
I could not get your new object to work for me... btw, I like the name, LOL! It would be interesting to type characters we both have in common on our keyboards and see if we get the same "key" value from DXscript widgets... I'll make a diagram of my keyboard and "key" values I'm getting and post it.
Reply #11 Sunday, April 3, 2005 6:25 AM
(Note: I couldn't get that site to work in Firefox, had to use IE. The other keys not included in that layout are the same as the english one.)
Note that the keys next to the Backspace and Enter button are used to create letters like àáä. Because we got three extra vowels (æ ø å) they keys are shiftet around a bit, so I think we have to use the Alt Gr button more.
As you said, we should really get the same code returned, at least for the OnChar() function. I'm wondering if the problems we have is that the functions and key values we use uses different character systems (ANSI, ASCII, Unicode)
I'm doing debugging on my text object at the moment. I'll report back.
(btw, what wasn't working with my object? Not sure what object to activate? try clicking each of them end pressing some keys. and make sure scripts are enabled.)
Reply #12 Sunday, April 3, 2005 6:32 AM
Reply #13 Sunday, April 3, 2005 8:59 AM
Green values are key values returned by OnChar. Values in square brackets are values returned when Shift is pressed, and curly brackets for AltGr.
Red values are the results from KeyDown/KeyUp key values.
Reply #14 Sunday, April 3, 2005 12:44 PM
Well, the biggest thing I've learned from this is that I should use OnChar function like you did in your text box object and not OnKeyDown/Up functions like I was trying. The OnChar values are correct and match.
I found this VBScript function, but haven't looked into it yet... Link
Reply #15 Sunday, April 3, 2005 12:47 PM
Reply #16 Sunday, April 3, 2005 1:49 PM
I managed to make my textbox accept the Euro sign. There is two additional variants of the Chr function, ChrB and ChrW. ChrW accepts Unicode values, and everything worked like a charm when I used that.
I've fixed the bugs (that I am aware of) with my Textbox object and are uploading it. Should be updated in a couple of days after it's been accepted.
Reply #17 Sunday, April 3, 2005 1:55 PM
| I didn't realize that I could just change the .zip to .dxpack and load it! |
It was in zip format??
Reply #18 Sunday, April 3, 2005 9:26 PM
| ChrW accepts Unicode values, and everything worked like a charm when I used that. |
Great!
| It was in zip format?? |
Yes, if I right click and use "Save Target As" (Internet Explorer), it comes up as "keyPeekaboo.zip" - but if I check the properties of the link, it is "keyPeekaboo.dxpack"... IE is weird, I need to make the switch to Firefox. Last time I checked, Firefox did not support VBScript, though - has this changed?
Anyway, thanks for your help on this thomassen!
I look forward to your textbox upload.Reply #19 Monday, April 4, 2005 6:58 AM
Not sure if Firefox support VBScript. Haven't tried it. But for websited I use JavaScrip because I think it's suported on more platforms thatn VBScript.
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Friday, April 1, 2005 2:41 AM
I seem to recall however, that if you look in the sample objects there is a text object that functions like an Edit control which will probably do the job for you.