{"id":1279,"date":"2012-04-30T17:06:43","date_gmt":"2012-04-30T22:06:43","guid":{"rendered":"http:\/\/anvil-of-time.com\/wordpress\/?p=1279"},"modified":"2021-03-24T14:10:04","modified_gmt":"2021-03-24T18:10:04","slug":"100-days-of-powerbuilder-day-6-adding-controls-to-a-form","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/100-days-of-powerbuilder-day-6-adding-controls-to-a-form\/","title":{"rendered":"100 Days of PowerBuilder &#8211; Day 6 &#8211; Adding Controls to a Form"},"content":{"rendered":"<p>This is part of my project &#8216;100 Days of PowerBuilder&#8217; which is a series of discussions focused on basic PowerBuilder development.<\/p>\n<p><em>Note: This article is written with examples created in PowerBuilder version 12.5. Most steps\/examples will be identical with any version going back to 9.<\/em><\/p>\n<p>Lets add some additional controls to our main form and check out some of the functionality of the PowerBuilder IDE. Once you have opened the main window object, choose Insert &#8211; Control from the menu.<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_01.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1290 size-full\" title=\"06_01\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_01.png\" alt=\"\" width=\"575\" height=\"509\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_01.png 575w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_01-300x265.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_01-150x132.png 150w\" sizes=\"(max-width: 575px) 100vw, 575px\" \/><\/a><\/p>\n<p>Now I&#8217;m sure there is some sort of organizational structure behind how the entries here are listed but I haven&#8217;t taken the time to figure it out. \u00a0You can also click on the down arrow icon next to the control icon on the toolbar.<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_02.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1291 size-full\" title=\"06_02\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_02.png\" alt=\"\" width=\"122\" height=\"205\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_02.png 122w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_02-89x150.png 89w\" sizes=\"(max-width: 122px) 100vw, 122px\" \/><\/a><\/p>\n<p>The icons within the red rectangle are the controls you can choose from. \u00a0Like many places in the IDE, the toolbar icon will take on the image from the last control chosen. \u00a0Each of the controls is assigned a default name when it is placed on the form. \u00a0The name consists of a defalt prefix and a sequence number. \u00a0You can control the prefix from within the Options dialog (menu option &#8216;Design &#8211; Options&#8217;). \u00a0When opening this dialog you are brought to the &#8216;General&#8217; tab.<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_03.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1292 size-full\" title=\"06_03\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_03.png\" alt=\"\" width=\"371\" height=\"499\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_03.png 371w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_03-223x300.png 223w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_03-111x150.png 111w\" sizes=\"(max-width: 371px) 100vw, 371px\" \/><\/a><\/p>\n<p>Here you can control the alignment grid (which appears on the window control) and whether controls default to a &#8216;3D&#8217; appearance.<\/p>\n<p>The prefixes are found on the next two tabs.<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_04.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1293 size-full\" title=\"06_04\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_04.png\" alt=\"\" width=\"373\" height=\"496\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_04.png 373w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_04-225x300.png 225w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_04-112x150.png 112w\" sizes=\"(max-width: 373px) 100vw, 373px\" \/><\/a>\u00a0<a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_05.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1294 size-full\" title=\"06_05\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_05.png\" alt=\"\" width=\"373\" height=\"498\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_05.png 373w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_05-224x300.png 224w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_05-112x150.png 112w\" sizes=\"(max-width: 373px) 100vw, 373px\" \/><\/a><\/p>\n<p>You can change these as you wish but each control must have a unique name when placed on a form within the IDE.<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_06.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1295 size-full\" title=\"06_06\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_06.png\" alt=\"\" width=\"368\" height=\"497\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_06.png 368w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_06-222x300.png 222w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_06-111x150.png 111w\" sizes=\"(max-width: 368px) 100vw, 368px\" \/><\/a><\/p>\n<p>The Script tab defines some script editor behavior (auto indent, dashes) and controls what type of messages appear when the script is compiled (when saved or when you leave the particular script). The Event and Function List Order contols how these lists appear in the editor.<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_07.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1296 size-full\" title=\"06_07\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_07.png\" alt=\"\" width=\"371\" height=\"496\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_07.png 371w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_07-224x300.png 224w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_07-112x150.png 112w\" sizes=\"(max-width: 371px) 100vw, 371px\" \/><\/a><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_08.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1297 size-full\" title=\"06_08\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_08.png\" alt=\"\" width=\"378\" height=\"498\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_08.png 378w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_08-227x300.png 227w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_08-113x150.png 113w\" sizes=\"(max-width: 378px) 100vw, 378px\" \/><\/a><\/p>\n<p>These tabs control the fonts within the script editor and when you choose to print out a script or control. Obviously some are more appropriate than others and are affected by the screen resolution of your monitor. If you change the font here you will need to exit and restart PB to apply the changes.<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_09.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1298 size-full\" title=\"06_09\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_09.png\" alt=\"\" width=\"375\" height=\"500\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_09.png 375w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_09-225x300.png 225w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_09-112x150.png 112w\" sizes=\"(max-width: 375px) 100vw, 375px\" \/><\/a><\/p>\n<p>Coloring refers to how various statements, keywords, and ect. appear in the editor.<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_10.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1299 size-full\" title=\"06_10\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_10.png\" alt=\"\" width=\"374\" height=\"499\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_10.png 374w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_10-224x300.png 224w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_10-112x150.png 112w\" sizes=\"(max-width: 374px) 100vw, 374px\" \/><\/a><\/p>\n<p>AutoScript is similar to Microsoft&#8217;s Intellisense where the IDE &#8216;guesses&#8217; at what you are doing based on what you type in. You will need ot experiment with this to get the optimal settings for your style of programming.<\/p>\n<p>So now select a SingleLineEdit (SLE) control to drop on your form.<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_16.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1305 size-full\" title=\"06_16\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_16.png\" alt=\"\" width=\"260\" height=\"206\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_16.png 260w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_16-150x118.png 150w\" sizes=\"(max-width: 260px) 100vw, 260px\" \/><\/a><\/p>\n<p>Drop a couple more for a total of three.<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_11.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1300 size-full\" title=\"06_11\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_11.png\" alt=\"\" width=\"330\" height=\"375\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_11.png 330w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_11-264x300.png 264w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_11-132x150.png 132w\" sizes=\"(max-width: 330px) 100vw, 330px\" \/><\/a><\/p>\n<p>The last control is &#8216;selected&#8217; since it has four &#8216;handles&#8217; in its corners. When an object is selected the Properties window shows information about it. Each type of object will have differing properties.<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_13.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1302 size-full\" title=\"06_13\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_13.png\" alt=\"\" width=\"370\" height=\"553\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_13.png 370w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_13-200x300.png 200w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_13-100x150.png 100w\" sizes=\"(max-width: 370px) 100vw, 370px\" \/><\/a><\/p>\n<p>The Font tab is used to set typeface related properties of the control. Note that if you change the TextSize the size of the control does not change; you will have to adjust it yourself.<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_14.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1303 size-full\" title=\"06_14\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_14.png\" alt=\"\" width=\"366\" height=\"531\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_14.png 366w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_14-206x300.png 206w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_14-103x150.png 103w\" sizes=\"(max-width: 366px) 100vw, 366px\" \/><\/a><\/p>\n<p>The Other tab in this case is primarily used for positional changes. Note that (nearly) all properties of controls can be manipulated from within the code of the application.<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_15.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1304 size-full\" title=\"06_15\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_15.png\" alt=\"\" width=\"370\" height=\"568\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_15.png 370w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_15-195x300.png 195w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_15-97x150.png 97w\" sizes=\"(max-width: 370px) 100vw, 370px\" \/><\/a><\/p>\n<p>Here&#8217;s a trick to saving time when placing a like number of controls on a form. If you want to change the Font, Color, Height, etc. of a control from the defaults PB gives you when you drop it on the form, change a single copy first, select it, choose the same type of control from the menu, and then drop it on the form. The new control will have some of the same properties already assigned to the one you had selected prior to dropping it.<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_17.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1306 size-full\" title=\"06_17\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_17.png\" alt=\"\" width=\"358\" height=\"383\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_17.png 358w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_17-280x300.png 280w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_17-140x150.png 140w\" sizes=\"(max-width: 358px) 100vw, 358px\" \/><\/a><\/p>\n<p>You can also achieve this by right clicking on a control and then choosing &#8216;duplicate&#8217; from the options menu.<\/p>\n<p>Manipulating Control Groups<\/p>\n<p>You can select multiple controls and manipulate them as a group should you so desire. Simply hold the Control key and click each control. If you selected one too many simply Control click to unselect it. Once a group of controls is selected, the Properties window shows common elements amongst the group. If all items in a group are of the same type, all the properties are available. If multiple controls are selected (say, SingleLineEdit and CommandButton) then a smaller subset of properties are available.<br \/>\n<a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_18.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1307 size-full\" title=\"06_18\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_18.png\" alt=\"\" width=\"371\" height=\"113\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_18.png 371w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_18-300x91.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_18-150x45.png 150w\" sizes=\"(max-width: 371px) 100vw, 371px\" \/><\/a><br \/>\nGroup Selected Properties<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_19.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1281 size-full\" title=\"06_19\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_19.png\" alt=\"\" width=\"376\" height=\"254\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_19.png 376w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_19-300x202.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_19-150x101.png 150w\" sizes=\"(max-width: 376px) 100vw, 376px\" \/><\/a><br \/>\nGroup Selected Properties for SingleLineEdit and CommandButton<\/p>\n<p>You can resize and position object groups by using the Positioning drop down toolbar<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_20.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1282 size-full\" title=\"06_20\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_20.png\" alt=\"\" width=\"53\" height=\"163\" \/><\/a><br \/>\nRemember that the first control selected in the group serves as the &#8216;master&#8217;; changing position and size will all be relative to the master control. In the case of spacing between objects the first two selected serve as the the &#8216;master&#8217;.<\/p>\n<p>Now we have the fields sized and aligned. When designing a form it&#8217;s always important to designate the &#8216;focus flow&#8217;. By this I mean the order in which the controls gain focus as the user tabs through the form. This is set by the Tab Order property and can be displayed from the toolbar icon or menu option.<\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_21.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1283 size-full\" title=\"06_21\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_21.png\" alt=\"\" width=\"341\" height=\"131\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_21.png 341w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_21-300x115.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_21-150x57.png 150w\" sizes=\"(max-width: 341px) 100vw, 341px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_22.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1284 size-full\" title=\"06_22\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_22.png\" alt=\"\" width=\"312\" height=\"199\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_22.png 312w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_22-300x191.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_22-150x95.png 150w\" sizes=\"(max-width: 312px) 100vw, 312px\" \/><\/a><\/p>\n<p>The tab order icon (or menu) acts as a &#8216;toggle&#8217; into &#8216;tab setting mode&#8217; which basically means you can&#8217;t do anything other than set the tab order until you toggle back out.<\/p>\n<p>In the case of the form I&#8217;ve set up, my tab order is slightly off. The tab stops themselves are displayed in the upper left corner of the control (in red). The actual order on the form is hightlighted by the arrows which have been added to show the actual flow; not the most intuitive.<br \/>\n<a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_23.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1285 size-full\" title=\"06_23\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_23.png\" alt=\"\" width=\"731\" height=\"361\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_23.png 731w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_23-300x148.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_23-150x74.png 150w\" sizes=\"(max-width: 731px) 100vw, 731px\" \/><\/a><br \/>\nClicking on the number of a specified tab order allows it to be changed. To &#8216;insert&#8217; a control between others on a form, simply use a number between the tab numbers of the controls. Once you toggle out of tab order the tab numbers themselves are recalculated into multiples of ten.<\/p>\n<p>Setting the tab order of the Exit button so it is last.<br \/>\n<a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_24.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1286 size-full\" title=\"06_24\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_24.png\" alt=\"\" width=\"128\" height=\"105\" \/><\/a><\/p>\n<p>Now if you run the application, the window opens and focus is set on the first SLE field. Pressing the tab key moves the focus to the subsequent fields and then the Exit button before starting over again at the initial field.<\/p>\n<p>Let&#8217;s put some functionality behind the SLE fields. Right Click on the first SLE and choose Script<br \/>\n<a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_25.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1287 size-full\" title=\"06_25\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_25.png\" alt=\"\" width=\"241\" height=\"98\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_25.png 241w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_25-150x60.png 150w\" sizes=\"(max-width: 241px) 100vw, 241px\" \/><\/a><\/p>\n<p>This takes you into the Powerscript Editor for the Event methods of the control. Clicking on the down arrow as shown will list all of the events for this particular control. The script currently in &#8216;edit&#8217; mode is highlighted.<br \/>\n<a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_26.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1288 size-full\" title=\"06_26\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_26.png\" alt=\"\" width=\"660\" height=\"277\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_26.png 660w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_26-300x125.png 300w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_26-150x62.png 150w\" sizes=\"(max-width: 660px) 100vw, 660px\" \/><\/a><br \/>\nIn this case the &#8216;modified&#8217; event is in edit mode. In this event script we will place code to change the background color of the field to indicate that it&#8217;s contents have been changed. The following will do this: <strong>Backcolor = RGB(255,255,0)<\/strong>. RGB is a system function which calculates the long value of a color based on it&#8217;s red, green, and blue component values (integers from 0 to 255). In this case we are changing the value to yellow.<\/p>\n<p>Now run the application, change the the contents of the first SLE, and then tab out of the field.<br \/>\n<a href=\"http:\/\/anvil-of-time.com\/wordpress\/wp-content\/uploads\/2012\/04\/06_27.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-1289 size-full\" title=\"06_27\" src=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_27.png\" alt=\"\" width=\"281\" height=\"255\" srcset=\"https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_27.png 281w, https:\/\/anvil-of-time.com\/wp-content\/uploads\/2012\/04\/06_27-150x136.png 150w\" sizes=\"(max-width: 281px) 100vw, 281px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is part of my project &#8216;100 Days of PowerBuilder&#8217; which is a series of discussions focused on basic PowerBuilder development. Note: This article is written with examples created in PowerBuilder version 12.5. Most steps\/examples will be identical with any version going back to 9. Lets add some additional controls to our main form and&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[86,3],"tags":[62],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/1279"}],"collection":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/comments?post=1279"}],"version-history":[{"count":5,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/1279\/revisions"}],"predecessor-version":[{"id":2213,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/1279\/revisions\/2213"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=1279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=1279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=1279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}