Search the Community
Showing results for tags 'OnkeyDown'.
-
Hi all, it seems that UniHTMLMemo does not fire events OnKeyDown and OnKeyUp. Is there any workaround ? Thanks Andrea
-
I have a Combobox which needs to be repopulated dinamically, that is, the user type 3 characters in the ComboBox and press the return key. In this moment a query is executed and the Combobox needs to be populated with the items resulted by that query. The problem that I found is that the ComboBox.Items.Clear doesn't have the expected effect. Here is a simple example: Add a TUniComboBox On the OnKeyDown method, add the code: if Key=VK_RETURN then begin UniComboBox1.Items.Clear; UniComboBox1.Items.Add('RIO DE JANEIRO'); UniComboBox1.Items.Add('RIO GRANDE DO SUL'); UniComboBox1.Items.Add('RIO GRANDE DO NORTE'); end; Run the program Inside the ComboBox, type "RIO" and press the return key: it will appear 3 items at the ComboBox Edit the typed text to "RIOS" and press the return key again In this moment I expected that the Combobox was cleared and populated with the 3 options, but the result obtained is that the ComboBox has 6 items, as if the "UniComboBox1.Items.Clear" instruction had been ignored. Thanks in advance!
-
Hi When I write below code in ClientEvents.ExtEvents on keydown for uniedit1 ,the control go on the next by enter key. function keydown(sender, e, eOpts) { if (e.getKey() == 13) { e.keyCode = e.TAB; return e.keyCode; } } Now I write below code,and put it in KeyDown event of UniEdit1.But don't apply. UniEdit1.ClientEvents.ExtEvents.Values['keydown']:='if (e.getKey() == 13) {e.keyCode = e.TAB;return e.keyCode;}'; Which event must be used? Best Regards.
-
I am getting further in having my app actually do something useful. I have 5 questions that are probably simple to answer, but since I'm a NEWBIE, I don't know the answers to them. QUESTION #1: I see two ways to create forms... 1. MyForm := TUniForm5.Create(UniApplication) 2. Result := TFormAnchor(UniMainModule.GetFormInstance(TFormAnchor)); Since method #2 is more commonly used everywhere, why do #1? Which is better? I also noticed that a bunch of forms have this sort of thing at the end... initialization RegisterClass(TUniMaskEdit); I presume this is so that the... FrC := TUniFrameClass(FindClass(FClassName)); line of code will find the class and be able to instantiate it onto a Tab in the page control, when the user clicks on the TreeView node? QUESTION #2: I noticed that you mentioned that the SHOW/SHOWMODAL should be in the same procedure that creates the form object, in an earlier post. Why should it be shown in the same event that creates the form object? QUESTION #3: What makes a form a "FreeForm" ? The forum said in an earlier post... Free form should be created in code manually. It is not managed by framework. What does that mean? QUESTION #4: Why is there a unitTimer? is TTimer not any good? QUESTION #5: From an earlie post, I saw... For example several times I've seen that developers do things like below: procedure TMainForm.UniEdit1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if Key = 13 then begin // do somthing end; end; Which doesn't make sense at all when you deploy your app on the web. It would make sense only in a gigabit LAN, but certainly makes no sense on the internet. I do this EXACT thing when the user presses the ESC key so I can exit the form. Why is that a bad idea? How else would I close the form when the user presses the ESC key?