TIP: Editcontrol setfocus |
Post Reply |
Author | |
joeliner
Senior Member Joined: 09 June 2006 Status: Offline Points: 273 |
Post Options
Thanks(0)
Posted: 25 September 2009 at 6:14am |
Hi guys, i wonder why it doesn't work out of the box but when you set editcontrol.setfocus you actually dont see the cursor blinking inside the editcontrol. Now you may not really want to execute but first allow the user to type some txt then execute. So after struggling with it for ages, this what i did:
Dim controlEdit as CommandBarEdit
Set controlEdit = Commandbars.FindControl(, ID_FIND_RECORD)
controlEdit.Setfocus
Sendkeys "{Enter}"
am sure this is something CJ can add in their code in future.
regards,
|
|
Product: Xtreme SuitePro (ActiveX) version 13.1
Platform: Windows XP SP 3 Language: Visual Basic 6 SP6 |
|
Mr.Den
Groupie Joined: 26 August 2007 Status: Offline Points: 50 |
Post Options
Thanks(0)
|
You can accomplish the same thing with the .Execute command:
|
|
Product: Xtreme SuitePro (ActiveX) version 16.3.1
Platform: Windows 7 Professional (64bit) - SP 1 Language: Visual Basic 6.0 SP 6 |
|
joeliner
Senior Member Joined: 09 June 2006 Status: Offline Points: 273 |
Post Options
Thanks(0)
|
Hi Mr. Den,
Am afraid not cause i have tried .execute countless times. The scenario is like that of the new windows Mail. You press Ctrl + E (which in our case can be a commandbarAction - ID_FIND_RECORD) and the cursor gets the focus on to the editcontrol. The user types some text e.g. 'code' and presses enter then the Execute command is executed. Get what I mean? |
|
Product: Xtreme SuitePro (ActiveX) version 13.1
Platform: Windows XP SP 3 Language: Visual Basic 6 SP6 |
|
Mr.Den
Groupie Joined: 26 August 2007 Status: Offline Points: 50 |
Post Options
Thanks(0)
|
I just tried this in a sample app and it worked with an edit field and an exit button:
Private Sub CommandBars_CommandBarKeyDown(CommandBar As XtremeCommandBars.ICommandBar, KeyCode As Long, Shift As Integer)
Select Case KeyCode
Case 13 CommandBars.FindControl(, ID_PB_EXIT).Execute End Select End Sub As soon as I pressed the enter key, the exit button fires. Is that what you mean?
|
|
Product: Xtreme SuitePro (ActiveX) version 16.3.1
Platform: Windows 7 Professional (64bit) - SP 1 Language: Visual Basic 6.0 SP 6 |
|
joeliner
Senior Member Joined: 09 June 2006 Status: Offline Points: 273 |
Post Options
Thanks(0)
|
Your right Mr. Den,
That scenario will work where the commandbars and editcontrol is on the same form or same App. My fault, I should have mentioned this, In my production enviroment, my form that has the editcontrol is in a dll and attached to a dockingpane. the commandbars on a main form. regards |
|
Product: Xtreme SuitePro (ActiveX) version 13.1
Platform: Windows XP SP 3 Language: Visual Basic 6 SP6 |
|
ManSys
Newbie Joined: 02 February 2010 Location: United Kingdom Status: Offline Points: 2 |
Post Options
Thanks(0)
|
This is causing me no end of grief - you can't even put a Custom Control on the form and set focus to that - no cursor is shown! My form is opened by a PopupControl held on another form and when the SendKeys is called it sends Codejock into a loop and crashes the app / vb. Very disappointing!
|
|
-
ManSys Limited |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |