选择显示字体大小

如何在数据窗口(datawindow)中用enter代替tab

如何在数据窗口(datawindow)中用enter代替tab在字段间移动

summary: this document shows the pb4.0 method and pb 5.0 method of programming the enter key to tab through a datawindow.
document id:44003last revised: 02/22/96
topic:datawindowsdocument type:technote
product:powerbuilderversion:5; 4
platform:pcoperating system:not operating system specific

document:

programming the enter key to move between columns in a datawindow

  general comments: the technique described below works fine in pb 5. the changes required are due to: 

(1) setactioncode() function made obsolete in pb 5.0 - we need to use events return codes instead.
(2) pb 5.0 new syntax to access the value of attributes in dw - instead of using describe() we can referenced the attribute directly. 

  description: how to change the enter key to act like a tab key.
  solution: to have the enter key act like a tab key, create a user event to correspond with the pbm_dwnprocessenter event on a datawindow. in that user event, add the following 2 lines:

  pb 5.0 method

  send(handle(this),256,9,long(0,0)) // send message for processing tab key
   return 1  // ignore processing of enter key 

example
// the following example does an accepttext.  if it gets a negative
// return code, then there was an error on the column, and you bypass
// the enter processing, and do not send the message for the tab key.
//
// it then checks to see if the current row and column are the last in
// the datawindow.   if they are, it inserts a new row, scrolls to it,
// and sets the column to the first column in the row.
//
// if it is not the last row and column, it sends the tab key message,
// and bypasses the enter key processing.
//
// note: this script is in the user-defined event for pbm_dwnprocessenter. 

if this.accepttext() < 0 then
  return 1
end if

if this.getcolumn() = long(dw_1.object.datawindow.column.count) then
 if this.getrow() = this.rowcount() then
   this.insertrow(0)
   this.scrolltorow(this.getrow() + 1)
   this.setcolumn(1)
   return 1
 end if
end if

  send(handle(this),256,9,long(0,0))
  return 1  

  pb 4.0 method

  send(handle(this),256,9,long(0,0))
  dw_1.setactioncode(1)
                 __-----> change this to whatever you called your
                          datawindow.

  this will send the windows message for the tab key, and will bypass the processing for the
  enter key. 

 example
// the following example does an accepttext.  if it gets a negative
// return code, then there was an error on the column, and you bypass
// the enter processing, and do not send the message for the tab key.


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons