What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Is it possible to limit the length of an EditControl?

Is it possible to limit the length of an EditControl?
Author: Message:
vikke
Senior Member
****

Avatar

Posts: 900
Reputation: 28
31 / Male / Flag
Joined: May 2006
RE: Is it possible to limit the length of an EditControl?
You code it instead:
code:
var MaxLength = 100;

function On<YOUR_EDIT_ID_HERE>Event_EditTextChanged(PlusWnd, ControlId)
{
  var Text = PlusWnd.GetControlText(ControlId);
  if(Text.length > MaxLength)
  {
    PlusWnd.SetControlText(ControlId, Text.substr(0, MaxLength));
  }
}


I havn't tried it but I think it should work. If it doesn't, I hope you get the idea.

Edit: if you want to add a beep you could use this function.
code:
function Beep(frequency, duration)
{
  Interop.Call("Kernel32.dll", "Beep", frequency, duration);
}

This post was edited on 10-21-2007 at 07:59 PM by vikke.
10-21-2007 07:50 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Is it possible to limit the length of an EditControl? - by MeEtc on 10-21-2007 at 07:38 PM
RE: Is it possible to limit the length of an EditControl? - by vikke on 10-21-2007 at 07:50 PM
RE: Is it possible to limit the length of an EditControl? - by Mike on 10-21-2007 at 09:22 PM
RE: Is it possible to limit the length of an EditControl? - by TYL3R on 10-21-2007 at 09:40 PM
RE: Is it possible to limit the length of an EditControl? - by MeEtc on 10-21-2007 at 09:47 PM
RE: Is it possible to limit the length of an EditControl? - by deAd on 10-21-2007 at 09:56 PM
RE: Is it possible to limit the length of an EditControl? - by MeEtc on 10-21-2007 at 09:58 PM
RE: RE: Is it possible to limit the length of an EditControl? - by deAd on 10-21-2007 at 10:27 PM
RE: Is it possible to limit the length of an EditControl? - by felipEx on 10-21-2007 at 10:01 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On