TreeView beeps when you tab?! << Back

If you have any TreeView in your program. You can put the focus in the TreeView, turn on the speakers for your computer, and then press the "Tab" key on your keyboard. You will hear the standard Windows warning sound.
  1. In 2008, I reported it here on the DAW forum, and Vincent from DAW said they were aware of the issue, and they would look for a solution
  2. In 2012, I figured out what's wrong, and I posted the solution on the forum under same thread. Dennis from DAW said he added this as a workaround to the bug report.
  3. In 2020, DF 20.0 Alpha 2, the same problem continues.

Run the following program, then hit the tab key, you shall hear the Windows warning chime.
Use Windows
Use DfTreeVw

Object oPanel is a ModalPanel
	Set pbSizeToClientArea to True
	Set Size to 200 200
	Object oTree is a TreeView
		Set Size to 185 200
		Set peAnchors to anAll
		Procedure OnCreateTree
			Handle hTest
			Get AddTreeItem "Test" 0 0 0 0 to hTest
		End_Procedure // OnCreateTree
	End_Object // oTree
	Object oButton is a Button
		Set Location to 185 0
		Set peAnchors to anBottom
	End_Object // oButton
End_Object // oPanel
Send Popup of oPanel
Here is the solution. Add that to your TreeView subclass.
Procedure Notify Integer wParam Integer lParam
    Integer iVoid iResult
    tWinNmHdr Header
    tWinNmTvKeyDown KeyInfo
    Forward Get Msg_Notify wParam lParam to iResult
    Move (MemCopy(AddressOf(Header), lParam, SizeOfType(tWinNmHdr))) to iVoid
    If (Header.Code = TVN_KEYDOWN) Begin
        Move (MemCopy(AddressOf(KeyInfo), lParam, SizeOfType(tWinNmTvKeyDown))) to iVoid
        If (KeyInfo.wVKey = VK_TAB) Procedure_Return TRUE
    Procedure_Return iResult
End_Procedure  // Notify
Free Web Hosting