Create new objects

In this category you can exchange your programming questions and solutions.
Post Reply
Manolo
Posts: 16
Joined: Fri Jun 15, 2007 4:57 pm

Create new objects

Post: # 743Post Manolo
Sat Jul 23, 2011 9:03 am

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.

Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

Create new objects

Post: # 744Post Marco
Sat Jul 23, 2011 4:07 pm

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

Manolo
Posts: 16
Joined: Fri Jun 15, 2007 4:57 pm

Create new objects

Post: # 745Post Manolo
Sat Jul 23, 2011 5:41 pm

It works perfect, tnx a lot!!!
(but could be interesting to have possibility to extend objects.)

Post Reply