Page 1 of 1

Create new objects

Posted: Sat Jul 23, 2011 9:03 am
by Manolo
Is it possible to extend or modify an object?
For example, I need an EDIT object that accepts just Alphabet and numbers. (no symbols, no space)
Tnx.

Create new objects

Posted: Sat Jul 23, 2011 4:07 pm
by Marco
here some code it needs only one simple sub
and in the string you put what you want the editbox to accept.
best regards


`=================================================
`=edit box that only exepts alphabet and numbers.=
`=================================================
object myform as form
  object editbox as edit
    onkeypress=filter
  end object
  showmodal
end object

sub filter(key as byte)
  if instr("ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",ucase$(chr$(key)))=0 then
    key=0
  end if
end sub

Create new objects

Posted: Sat Jul 23, 2011 5:41 pm
by Manolo
It works perfect, tnx a lot!!!
(but could be interesting to have possibility to extend objects.)