-
Content Count
2,482 -
Joined
-
Last visited
Everything posted by miCRoSCoPiC^eaRthLinG
-
That is simply awesome oiboy - I could say even I've had similar experiences staying here in Thailand (but then again I'm originally from India, where you'd find this same beauracracy 10 times over). But I completely understand you feelings and having stayed myself in some remote corners of Thailand from time to time, know exactly what you're talking about. I do plan to visit China sometime soon - as you should take a trip down to Thailand as well (if you haven't been there already)...As for the rest, Welcome to Xisto and have an enjoyable stay. On behalf of the Xisto staff I extend you a very warm welcome. :(Regards,m^e
-
Switch the language of the Textbox Control automatically upon receiving focus Hi guys, This tutorial sparked off from my own ventures to incorporate a particular feature in my own software - which uses mixed language (English & Thai) on a couple of screens to store user data. Certain fields, apart from First & Last Names & parts of address were to be entered in Thai. Now the current language can be easily switched by pressing Alt-Left Shift (or whatever key combination you've set your system to) - but when you consider the same key-combination has to be repeated for over 20 fields on each screen - and this times the number of records you have to enter, then is becomes a dull and humongously tedious venture. This might lead to a lot of typo's too. (In my case the users of my software had to enter over 4000 student records - soooooo... I had to do something to make the lives of those poor guys a little easier.) So I thought, why not let the software do the language switching instead. I mean, the fields which were supposed to be in english and thai - were fixed, i.e. you couldn't use these languages alternatively.. so why not, let the system switch to Thai upon focus on such a thai data entry field and similarly for English ? So here I am with the solution - for anyone who might face such a situation (which I believe is very very common). This code will work for any language combination (or even more than two languages) with extremely minor modifications. Of course, you HAVE TO HAVE all these language packs installed on Windows to be able to switch back and forth between them. First things first: One convention I found very useful in achieving this effect, is to include part of the language name in the Name property of Textbox - this can then be used to easily determine which language to switch to in the corresponding textbox. Following this, I named all my Thai textboxes ending with the word "Thai" and "Engl" for the English textboxes. In reality, this is irrelevant. You can name your textboxes to whatever you feel like, as there is a better way to do it. Each control in .NET has a very little used property called .Tag - which can be used to store any kind of information about that control for internal use. We'll use this .Tag property to store the language of the control. Step 1 Let us start by firing up the VS.NET Studio & creating an empty VB.NET project with just one form. Add at least TWO textboxes to this form (feel free to add more and experiment around with them - but for demonstration's sake, am going to use just two). Now, in this example we'll use two Constants to store the words "ENGL" and "THAI" - so that we don't have to rewrite these words on every instance, lessening our chances of error. Let's consider these two words as nicknames to refer to these languages. 'Constant for english language Private Const _ENGLISH As String = "ENGL" 'Constant for thai language Private Const _THAI As String = "THAI" 'A Temporary variable to hold the color of a control Private OriginalColor As Color In the Property Inspector enter txtNameThai as the name of the first box, and txtNameEnglish for the second one. AND, the real part: Set the .Tag property of txtNameEnglish to "ENGL" Set the same for txtNameThai to "THAI" That's it - the stage is set. Onto the actual code now. Step 2 Go to the Code View of the form and create the empty skeleton procedures for the Focus event of the first textbox. When you first create a skeleton event handler procedure, using the dropdown boxes on top of the editor, the basic structure looks like this: Private Sub txtNameThai_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles txtNameThai.GotFocus End Sub Now, supposing we have over 20 different textboxes on the form - writing the language switching code for ALL of them is tedious and produces useless, redundant code. So we'll point the event handlers for ALL the textboxes to this one procedure. I simply modified the code a triffle bit to handle the focus event for the second textbox too. READ THE COMMENTS. ' Modified code to handle focus events of ALL textboxes' Notice how I simply added the the focus event of the second textbox after the Handles clause' If you have more than two textboxes, add the names of all of them here separated by commas. Private Sub TextBoxes_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles txtNameEnglish.GotFocus, txtNameThai.GotFocus End Sub Next steo is to incorporate the actual code to switch languages. Since this subroutine handles the focus events of multiple textboxes, we'll use the arguement sender to determine which control has current focus - and also determine the language to be switched to using the same. Add this code inside the sub: 'Method to handle GotFocus events for both textboxes Private Sub TextBoxes_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles txtNameEnglish.GotFocus, txtNameThai.GotFocus '=========================================================================== ' FIRST PART - LANGUAGE SWITCHING '=========================================================================== 'We'll use the case statement to inspect the sender objects .Tag property Select Case sender.Tag Case _THAI 'If the Tag contains the word "THAI" 'Loop through all the installed languages on this system For Each Lng As InputLanguage In InputLanguage.InstalledInputLanguages 'If there exists a language whose DisplayName has got the 'word "THAI" in it If Lng.Culture.DisplayName.ToUpper.StartsWith(_THAI) Then 'Change current input language to that InputLanguage.CurrentInputLanguage = Lng 'Exit for - coz we have found our language and no need to 'go through the rest of the loop Exit For End If Next Case _ENGLISH 'If the Tag contains the word "ENGL" 'Loop through all the installed languages on this system For Each Lng As InputLanguage In InputLanguage.InstalledInputLanguages 'If there exists a language whose DisplayName has got the 'word "ENGL" in it If Lng.Culture.DisplayName.ToUpper.StartsWith(_ENGLISH) Then 'Change current input language to that InputLanguage.CurrentInputLanguage = Lng 'Exit for - coz we have found our language and no need to 'go through the rest of the loop Exit For End If Next End Select End Sub A little explanation: I'm using the sender.Tag property to bring up the name string of the currently focused control. Remember, how I emphasized on setting the Tag properties for both to the nicknames we chose for each of the languages - notice how it comes to handy here. If sender.name.endswith("Thai") - determines if the control's name endswith the string "Thai". If found so, we step into the next line, which is a For Each loop. Now we can skip this line and switch the language directly, but a better way would be to use the For..Each loop, as this implements an extra check for the installed languages on the system. This safeguards the case, where the desired language is missing from the system - and block the possibilities of runtime errors when the code tries to switch to a non-existant language. READ THE COMMENTS. Select Case sender.Tag Case _THAI 'If the Tag contains the word "THAI" 'Loop through all the installed languages on this system For Each Lng As InputLanguage In InputLanguage.InstalledInputLanguages 'If there exists a language whose DisplayName has got the 'word "THAI" in it If Lng.Culture.DisplayName.ToUpper.StartsWith(_THAI) Then 'Change current input language to that InputLanguage.CurrentInputLanguage = Lng 'Exit for - coz we have found our language and no need to 'go through the rest of the loop Exit For End If Next 'English code follows exactly same syntax - except that THAI is replaced by ENGLEnd If If you need to switch between more than two languages, you need to implement more cross-checks by using more than two CASE statements for the .Tag property and implement appropriate language switching cycles in each case. Another small trick than you can add to this to enhance your interface is - change the background color of the textbox which has current focus. This allows the user to follow the field being currently edited in a much easier manner. All you've to do, is in this same GotFocus procedure, you add a couple of more lines after switching the language. This code Saves the current back color of the control and switches it to our desired color. '=========================================================================== ' SECOND PART - COLOR SWITCHING '=========================================================================== 'First Store the Original Color OriginalColor = sender.BackColor 'Simply switch the back-color of the sender sender.BackColor = Color.PapayaWhip Remember, if you use this trick - you'll also have to include the LostFocus procedure which will reset the textboxe's back-color to white upon loosing focus - else all your textboxes will end up with the focus color as you navigate through them. 'Method to turn the fields white on lostfocus Private Sub TextFields_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles txtNameThai.LostFocus, txtNameEnglish.LostFocus '=========================================================================== ' COLOR SWITCHING - BACK TO THE ORIGINAL '=========================================================================== 'Switch the back color to the original one sender.BackColor = OriginalColor End SubAs demonstrated here - this code switches the back-color to the original color upon loosing focus - and once again handles all your textfield in a single procedure. Hope these two nifty tricks help you enliven your application - I for one find them very very useful - and from personal experience, these make the users happy too - as they have to use far less keys. Comments & Feedbacks much appreciated. Attached File: Sample working project containing the above code.
-
Psychedelic - Anyone ?
miCRoSCoPiC^eaRthLinG replied to miCRoSCoPiC^eaRthLinG's topic in General Discussion
Naah Axel F - was the theme music of Beverly Hill Cops, and named after the lead character Axel Folly. That would perhaps come under some sort of old electronica genre but certainly not under psychedelic... Psy, my friend, is a completely different story. You can still connect to me when we are online, but no guarantees that the connection will be steady till I switch to SDSL with fixed IP's. Now with ADSL, you'd get download speeds exactly half of my line speed + throw in the bottleneck at your end.... but it's still worth a try. Twitch connected to me and dumped quite a few cool songs on my server -
Yahoo! Protocol Tutorial - Any Interest?
miCRoSCoPiC^eaRthLinG replied to tansqrx's topic in Search Engines
Sure make it quick *waiting breathlessly* -
Psychedelic - Anyone ?
miCRoSCoPiC^eaRthLinG replied to miCRoSCoPiC^eaRthLinG's topic in General Discussion
Naah Axel F - was the theme music of Beverly Hill Cops, and named after the lead character Axel Folly. That would perhaps come under some sort of old electronica genre but certainly not under psychedelic... Psy, my friend, is a completely different story. You can still connect to me when we are online, but no guarantees that the connection will be steady till I switch to SDSL with fixed IP's. Now with ADSL, you'd get download speeds exactly half of my line speed + throw in the bottleneck at your end.... but it's still worth a try. Twitch connected to me and dumped quite a few cool songs on my server -
Forum Form Thing Doesnt Work
miCRoSCoPiC^eaRthLinG replied to theillestmc12's topic in Web Hosting Support
It's because the Application form is hosted on the Panda Server too - which has crashed today evening. Fortunately they were able to save all the data which is being transfered to another server. According to my best guess, it'll be a 12hour wait before things return to normal... -
Psychedelic - Anyone ?
miCRoSCoPiC^eaRthLinG replied to miCRoSCoPiC^eaRthLinG's topic in General Discussion
It will be publicly avaiable (selectively of course ) - even now it's online, but I'm not really giving out a login to everyone, coz I still don't have a fixed IP - so I've to keep informing people about my new IP everytime I connect. Starting from next month onwards, I'll get a whole block of IP's for our office and then we can all have some fun -
What's On Your Lan?
miCRoSCoPiC^eaRthLinG replied to nightfox1405241487's topic in Computer Networks
Here goes.... Primary Server (Storage & Sharing): 3Ghz P4 running on Redhat Enterprise AS 3 - with 160GBx2 Raid 1 Web+DNS Server (configured and connected to the LAN but not serving WAN requests yet): Same 3Ghz P4 running on Fedora Core 3 - 80GBx2 Raid 1 Mail & FTP Server: Celeron 500 running RHEL AS 3 Workstations: Four 2.4 Ghz P4 for Development work (including mine) Two DVD burners One Brother Laser Printer (network enabled) + Two Epson inkjets 3Com 26 Port FDDI Gigabit Switch here comes the fun part - we threw away all the UTP based ethernet cards - my LAN's running on Fibre Optic now So all of them are FDDI based. Lone UTP connection is between the switch and a stupid ADSL modem+router (which I'm going to get rid of very soon and replace it with a separate CISCO switch and broadband modem. That's it I guess, for now... this LANs going to SPAN the street in front as soon as I get my own house right across the street... through FDDI of course -
Okayyyy - will do But you still got to carry out the formalities. Make a new hosting request using the same form for package two and I'll send it to the new account. BTW, the email sending is automatic (to the account you used to signup for this board), so rather than me sending it to your new account, you should update your profile information and enter the new email address there, so that the confirmation mail gets sent directly to that. Regards, m^e
-
Psychedelic - Anyone ?
miCRoSCoPiC^eaRthLinG replied to miCRoSCoPiC^eaRthLinG's topic in General Discussion
Ahhaaa wonderful Finally found someone who listens to the stuff I do.. great man, bring on whatever you have and lets see what we can share.. Have you heard of this other band amed 1200micrograms - they have some amazing hallucinogen tracks I got a whole album of theirs.. also some hard grunching numbers by 3D Vision and Hux Flux.. -
Hi guys, Once again, those who are into hard electronica & psychedelic (goa/israeli) can pm me to share some songs... I got a couple of GB of the coolest ones all neatly tucked away on my personal FTP server Not many people listen to this kind of music, but those who do would recognize the following band names for sure: Astral Projections Astrix Bamboo Forest Skazi Infected Mushrooms Alient Project all these and a hell lot more .... eagerly waiting for someone to join in and share the fun
-
Nope.. all you've to do is First point your domain to use the Xisto nameservers - ns1.astahost.com and ns2.astahost.com - and only then you can use your domain to signup for an account. Now that you've already created a subdomain, if you want to link your domain with your present asta account - you should get in touch with NilsC or OpaQue.
-
Linux Vs. Windows What do you think?
miCRoSCoPiC^eaRthLinG replied to Trojan's topic in Websites and Web Designing
There are about a 1000 threads on this - check in the War of the OS World forum, you'll find plenty of opinions and polls. Thread closed. -
Noobular Question! bear with me, please?
miCRoSCoPiC^eaRthLinG replied to WREKANYZE's topic in Web Hosting Support
Your host/server address is the domain/subdomain name you used to create your account at Xisto. For example, if my account was wrekanyze.astahost.com - that's what I'd use with WSFTP to get into my account. The login name/password would be what you chose during your account creation, i.e. the same one that you use to get into your cPanel. Regards, m^e -
Yahoo! Protocol Tutorial - Any Interest?
miCRoSCoPiC^eaRthLinG replied to tansqrx's topic in Search Engines
All I can say is, Hell yeah!! - just do it man.. we're all waiting here anxiously to read all about your great research -
Photography In College
miCRoSCoPiC^eaRthLinG replied to PretzelAddict2's topic in Graphics, Design & Animation
Nice to see the Photography forum drawing a diverse variety of posts - but sorry, even I can't help you in your quest. I'm situated exactly at the other end of the world But good luck with you hunt - and if you feel like engaging in a discussion on anything to do with photography, you'll always find me here every-ready to do it :(Regards,m^e -
As I can see your hosting token (that was acitvated when your account was approved) - hasn't been used up. There was some sort of error in the signup gateway - so you can go and try once again. Only problem you might face is that you might have to choose a different sub-domain as the earlier one might have got locked up. As long as you choose a different subdomain and try again, your account should be created without any hitch. And this time... WAIT Once you're done let us know of your success / problems.Regards,m^e
-
I'm into active software developmet and as mentioned earlier - I find Intel platforms way better than AMD for handling coding intensive taks. AMD might be better for gaming - but one huge problem with AMD, that I've personally experienced is overheating and freezing very frequently. I tried 3-4 AMD processors with vastly different clock-speed and faced the same problem with varying degree in all of them... that was enough to refrain me from venturing back the AMD path... with Intel at least, I never had to worry about that problem - even in the least. Intel 3Ghz proc handles any amount of coding tools I care to throw upon it.. without the slightest hiccup !!! And that speaks volumes for it - infact, I'm so impressed with it's performance, that I've switched to a complete Intel set - both CPU and motherboard - and am thoroughly enjoying what I'm getting for the marginal difference (more) I had to pay for it.. Regards,m^e
-
i thought of coming back and adding this in: While I'm using a 1Meg ADSL link here in Thailand and I was feeling lucky - I was amazed to hear recently, that my home country India, is one of the FIRST ever to offer ADSL2 - which offers download speeds upto at least 25MB/s - and right now, only U.S. and India are the ONLY two countires in the whole wide world offering these standards. The rest are busy implementing it yet - most will get it done sometime later this year. Now, I've been out of my home for almost past 5 years, and I'm extremely impressed to hear about such fantastic developments in the communications front... In fact, even when I was back home, I'd worked in the Network Design section of a company named Reliance Telecom, India which was setting up a 3 Terrabyte Fibre Optic backbone all over the country, which was to (possibly) link every home/office all over the country through high-grade copper core wires joining up with the main FDDI backbone through certain ports known as the MAN or Metropolitain Access Nodes. I'm overjoyed to hear that all of it has worked out for the better and this post is simply to share the delight with you guys ... Regards, m^e
-
Windows Xp: Simple Way Of Obtaining Admin Access
miCRoSCoPiC^eaRthLinG replied to remy's topic in Security issues & Exploits
Nice tip - that solves a lot of questions regarding lost admin passwords on the XP genre. That's a really cooool tip - as long as you've got direct access to the XP box. But anyways, as long as you;ve got direct access to the machine in concern, you can, somehow or the other, manage to get in - even if it was linux that we were talking about (which is about 'n' million times more secure than any version of Windows will EVER BE).... Popular Quote: Linux: What Windows will NEVER BE -
Networking With Linux & Windows
miCRoSCoPiC^eaRthLinG replied to Cookiemonster1405241499's topic in Computer Networks
Mail handling's a different story bro - nothing as powerful as linux when it comes to it - but as always, it needs a good bit of configuring... Lemme know if you need any help on it I'm experimenting with it myself at this point and have picked up a good lot. -
Question's About Hosting At Astahost
miCRoSCoPiC^eaRthLinG replied to jerre's topic in Web Hosting Support
That makes it three question What number system do you count in ? (j/k) Nope. No new hosting request is needed. As long as your credits don't drop below -30, i.e. you are not inactive for 30 full days, you have a fair chance to make some more posts and get your account back. If your credits are in the negative zone, you have to make enough posts to pull it back up to a positive figure and then wait for about an hours time for the system to automatically re-activate your hosting account. But once it dips below -30, your hosting account is auto-cancelled and you'll have to reapply. This is a far fetched situation, and I don't see any reason why you shouldn't be able to keep it up in a +ve region. Yup - even for Package two, the hosting credits get deducted by the same amount, i.e. 1 hosting credit for every real world day of 24hours. But when you apply and get your upgrade package, 30 credits are deducted straight from your account as upgrade costs - and only then the actual 1credit/day cycle begins.. so if you're applying for an upgrade, make sure you have at least 2-3 credits above 30 - just to be sure that your account doesn't get suspended immediately after. Yup - Xisto - Web Hosting.Com is the paid version of Xisto, which offers hosting for as low as $10 / year - same or more features depending on the rate slab you take up. No posting is needed with such an account. Infact, quite a few members of Xisto, who haven't been able to keep up with the posting requirements have shifted to Xisto - Web Hosting coz it's so cheap. Xisto (Free), Xisto (Free) & Xisto - Web Hosting (Paid) - all are a part of the Xisto network offering similar services based on different criteria. Apart from that we have two other sites, which are under the Xisto ring - IPBGaming.Com (which is a gaming + forum) site and AntiLost.Com - which is a recently launched OpenSource Project Development and Hosting site.... Hope this helps... Regards, m^e