KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Why does one work, but not the other?

 
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion
View previous topic :: View next topic  
Author Message
Viggen
KiXforms Regular
KiXforms Regular


Joined: 28 Jun 2005
Posts: 40

PostPosted: Fri Sep 19, 2008 7:58 am    Post subject: Why does one work, but not the other? Reply with quote

Hi guys!

This is making me crazy...

I asked a question here, and and the aswer I got works great in this short script:


Code:
Break On
$System = CreateObject("Kixforms.System")
If Not $System
   $nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
   Quit()
EndIf
$nul = $System.Application.EnableVisualStyles

Global $CtrlKeyDown
$CtrlKeyDown = 0 ;no

$About_Form = $System.Form()
$About_Form.KeyDown = "CheckForKeyDown()"
$About_Form.KeyUp = "CheckForKeyUp()"
$About_Form.Left = 0
$About_Form.StartPosition = 0  ;FormStartPosition_Manual
$About_Form.Size = $System.Size(365,214) ;(Width,Height)
$About_Form.Text = "Form"
$About_Form.FormBorderStyle = 5
$About_Form.Topmost = -1
$About_Form.ShowInTaskbar = 0
$About_Form.Top = 0

$Label1 = $System.Label()
$Label1.Font = $System.Font("Microsoft Sans Serif",8.25,4) ;Underline
$Label1.ForeColor = $System.Color.FromName("HotTrack")
$Label1.Height = 12
$Label1.Left = 92
$Label1.Text = "www.google.com"
$Label1.TextAlign = 32  ;MiddleCenter
$Label1.Top = 65
$Label1.Width = 150
$Label1.Click = 'test("http://www.google.com")'
$Label1.Cursor = $System.Cursors.Hand
$nul = $About_Form.Controls.Add($Label1)

$About_Form.Show  ;Displays the Form

While $About_Form.Visible
   $Nul = Execute($About_Form.DoEvents())
Loop
Exit 0

Function test($URL)
  If $CtrlKeyDown = 1 ;yes
    ? 'CTRL'
    ? $KeyChar
  Else
    ? $KeyChar ;Run 'explorer.exe "' + $URL + '"'
  EndIf
EndFunction

Function CheckForKeyDown()
   $KeyChar = $About_Form.KeyDownEventArgs.KeyCode
   If $KeyChar = 17
      $CtrlKeyDown = 1 ;yes
  EndIf
EndFunction

Function CheckForKeyUp()
   $KeyChar = $About_Form.KeyDownEventArgs.KeyCode
   If $KeyChar = 17
    $CtrlKeyDown = 0 ;no
    $KeyChar = ""
  EndIf
EndFunction



But in this longer script it dosen't detect the KeyDown or KeyUp events Question Question Question

My guess is that as usual I'm missing something obvious Embarassed

here goes:


[code]Break On
$System = CreateObject("Kixforms.System")
If Not $System
$nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
Quit()
EndIf
$nul = $System.Application.EnableVisualStyles

Global $CtrlKeyDown

$CtrlKeyDown = 0

$About_Form = $System.Form()
$About_Form.KeyDown = "CheckForKeyDown()"
$About_Form.KeyUp = "CheckForKeyUp()"
$About_Form.FormBorderStyle = 5
$About_Form.Left = 0
$About_Form.StartPosition = 0
$About_Form.Size = $System.Size(758,388)
$About_Form.Text = "(c) Aktiv IT Partner I Wermland AB och Würth Svenska AB"
$About_Form.Topmost = -1
$About_Form.ShowInTaskbar = 0
$About_Form.Top = 0

$About_Form.BackGroundImage = AboutBackGroundImage()

$About_Form_url_Label = $System.Label()
$About_Form_url_Label.BackColor = $System.Color.FromName("Transparent")
$About_Form_url_Label.Font = $System.Font("Microsoft Sans Serif",9,4) ;Underline
$About_Form_url_Label.ForeColor = $System.Color.FromName("White")
$About_Form_url_Label.Height = 17
$About_Form_url_Label.Left = 255
$About_Form_url_Label.Text = "www.aktivit.se"
$About_Form_url_Label.Top = 57
$About_Form_url_Label.Width = 83
$About_Form_url_Label.Cursor = $System.Cursors.Hand
$About_Form_url_Label.Click = 'web("http://www.aktivit.se")'
$nul = $About_Form.Controls.Add($About_Form_url_Label)

$About_Form_Close_Button = $System.Button()
$About_Form_Close_Button.FlatStyle = 3 ;System
$About_Form_Close_Button.Left = 701
$About_Form_Close_Button.Text = "Stäng"
$About_Form_Close_Button.Top = 343
$About_Form_Close_Button.Width = 53
$About_Form_Close_Button.Click = "Close_About()"
$nul = $About_Form.Controls.Add($About_Form_Close_Button)

$About_Form_Version_Label1_1 = $System.Label()
$About_Form_Version_Label1_1.BackColor = $System.Color.FromName("Transparent")
$About_Form_Version_Label1_1.Font = $System.Font("Microsoft Sans Serif",9,0) ;Regular
$About_Form_Version_Label1_1.ForeColor = $System.Color.FromName("White")
$About_Form_Version_Label1_1.Height = 17
$About_Form_Version_Label1_1.Left = 655
$About_Form_Version_Label1_1.Text = "Version:"
$About_Form_Version_Label1_1.Top = 3
$About_Form_Version_Label1_1.Width = 52
$nul = $About_Form.Controls.Add($About_Form_Version_Label1_1)

$About_Form_Version_Label1_2 = $System.Label()
$About_Form_Version_Label1_2.BackColor = $System.Color.FromName("Transparent")
$About_Form_Version_Label1_2.Font = $System.Font("Microsoft Sans Serif",9,1) ;Bold
$About_Form_Version_Label1_2.ForeColor = $System.Color.FromName("White")
$About_Form_Version_Label1_2.Height = 17
$About_Form_Version_Label1_2.Left = 704
$About_Form_Version_Label1_2.Text = "0.0.0"
$About_Form_Version_Label1_2.Top = 3
$About_Form_Version_Label1_2.Width = 46
$About_Form_Version_Label1_2.Click = "Set_Adm_Pwd()"
$nul = $About_Form.Controls.Add($About_Form_Version_Label1_2)

$About_Form_wurth_url_label = $System.Label()
$About_Form_wurth_url_label.BackColor = $System.Color.FromName("Transparent")
$About_Form_wurth_url_label.Font = $System.Font("Microsoft Sans Serif",9,4) ;Underline
$About_Form_wurth_url_label.ForeColor = $System.Color.FromName("White")
$About_Form_wurth_url_label.Height = 17
$About_Form_wurth_url_label.Left = 152
$About_Form_wurth_url_label.Text = "www.wuerth.se"
$About_Form_wurth_url_label.Top = 320
$About_Form_wurth_url_label.Width = 88
$About_Form_wurth_url_label.Cursor = $System.Cursors.Hand
$About_Form_wurth_url_label.Click = 'web("www.wuerth.se")'
$nul = $About_Form.Controls.Add($About_Form_wurth_url_label)

$About_Form_GroupBox1 = $System.GroupBox()
$About_Form_GroupBox1.BackColor = $System.Color.FromName("Transparent")
$About_Form_GroupBox1.ForeColor = $System.Color.FromName("White")
$About_Form_GroupBox1.Height = 202
$About_Form_GroupBox1.Left = 160
$About_Form_GroupBox1.Text = ""
$About_Form_GroupBox1.Top = 81
$About_Form_GroupBox1.Width = 221
$nul = $About_Form.Controls.Add($About_Form_GroupBox1)

$About_Form_GroupBox1.BackGroundImage = $About_Form_GroupBox1BackGroundImage()

$About_Form_Label18 = $System.Label()
$About_Form_Label18.Font = $System.Font("Microsoft Sans Serif",10,0) ;Regular
$About_Form_Label18.Left = 7
$About_Form_Label18.Text = "besvaras av: Würth Svenska AB"
$About_Form_Label18.Top = 47
$About_Form_Label18.Width = 204
$nul = $About_Form_GroupBox1.Controls.Add($About_Form_Label18)

$About_Form_Label17 = $System.Label()
$About_Form_Label17.Left = 12
$About_Form_Label17.Text = "(innehåll, artikelpriser m.m)"
$About_Form_Label17.Top = 30
$About_Form_Label17.Width = 141
$nul = $About_Form_GroupBox1.Controls.Add($About_Form_Label17)

$About_Form_Label16 = $System.Label()
$About_Form_Label16.Font = $System.Font("Microsoft Sans Serif",10,0) ;Regular
$About_Form_Label16.Left = 7
$About_Form_Label16.Text = "Frågor ang. artikelregistret"
$About_Form_Label16.Top = 13
$About_Form_Label16.Width = 168
$nul = $About_Form_GroupBox1.Controls.Add($About_Form_Label16)

$About_Form_Label20 = $System.Label()
$About_Form_Label20.Font = $System.Font("Microsoft Sans Serif",9,0) ;Regular
$About_Form_Label20.ForeColor = $System.Color.FromName("Black")
$About_Form_Label20.Height = 19
$About_Form_Label20.Left = -1
$About_Form_Label20.Text = ""
$About_Form_Label20.Top = 78
$About_Form_Label20.Width = 14
$nul = $About_Form_GroupBox1.Controls.Add($About_Form_Label20)

$About_Form_Label21 = $System.Label()
$About_Form_Label21.Font = $System.Font("Microsoft Sans Serif",9,0) ;Regular
$About_Form_Label21.ForeColor = $System.Color.FromName("Black")
$About_Form_Label21.Height = 19
$About_Form_Label21.Left = 183
$About_Form_Label21.Text = ""
$About_Form_Label21.Top = 81
$About_Form_Label21.Width = 14
$nul = $About_Form_GroupBox1.Controls.Add($About_Form_Label21)

$About_Form_Label19 = $System.Label()
$About_Form_Label19.Font = $System.Font("Microsoft Sans Serif",12,5) ;Bold & Underline
$About_Form_Label19.Height = 20
$About_Form_Label19.Left = 8
$About_Form_Label19.Text = ". Kontakt ."
$About_Form_Label19.TextAlign = 32 ;MiddleCenter
$About_Form_Label19.Top = 78
$About_Form_Label19.Width = 180
$nul = $About_Form_GroupBox1.Controls.Add($About_Form_Label19)

$About_Form_Label25 = $System.Label()
$About_Form_Label25.Font = $System.Font("Microsoft Sans Serif",9,0) ;Regular
$About_Form_Label25.Height = 19
$About_Form_Label25.Left = 46
$About_Form_Label25.Text = "019 - 35 10 30"
$About_Form_Label25.Top = 110
$About_Form_Label25.Width = 111
$nul = $About_Form_GroupBox1.Controls.Add($About_Form_Label25)

$About_Form_Label26 = $System.Label()
$About_Form_Label26.Font = $System.Font("Microsoft Sans Serif",9,0) ;Regular
$About_Form_Label26.Height = 19
$About_Form_Label26.Left = 46
$About_Form_Label26.Text = "019 - 35 10 39"
$About_Form_Label26.Top = 141
$About_Form_Label26.Width = 111
$nul = $About_Form_GroupBox1.Controls.Add($About_Form_Label26)

$About_Form_wurth_mail_Label = $System.Label()
$About_Form_wurth_mail_Label.Font = $System.Font("Microsoft Sans Serif",9,4) ;Underline
$About_Form_wurth_mail_Label.Height = 15
$About_Form_wurth_mail_Label.Left = 67
$About_Form_wurth_mail_Label.Text = "kundsupport@@wuerth.se"
$About_Form_wurth_mail_Label.Top = 172
$About_Form_wurth_mail_Label.Width = 140
$nul = $About_Form_GroupBox1.Controls.Add($About_Form_wurth_mail_Label)

$About_Form_Label22 = $System.Label()
$About_Form_Label22.Font = $System.Font("Microsoft Sans Serif",10,1) ;Bold
$About_Form_Label22.Height = 18
$About_Form_Label22.Left = 12
$About_Form_Label22.Text = "Tel:"
$About_Form_Label22.Top = 110
$nul = $About_Form_GroupBox1.Controls.Add($About_Form_Label22)

$About_Form_Label23 = $System.Label()
$About_Form_Label23.Font = $System.Font("Microsoft Sans Serif",10,1) ;Bold
$About_Form_Label23.Height = 18
$About_Form_Label23.Left = 12
$About_Form_Label23.Text = "Fax:"
$About_Form_Label23.Top = 141
$nul = $About_Form_GroupBox1.Controls.Add($About_Form_Label23)

$About_Form_Label24 = $System.Label()
$About_Form_Label24.Font = $System.Font("Microsoft Sans Serif",10,1) ;Bold
$About_Form_Label24.Height = 18
$About_Form_Label24.Left = 12
$About_Form_Label24.Text = "E-post:"
$About_Form_Label24.Top = 173
$nul = $About_Form_GroupBox1.Controls.Add($About_Form_Label24)

$About_Form_GroupBox2 = $System.GroupBox()
$About_Form_GroupBox2.BackColor = $System.Color.FromName("Transparent")
$About_Form_GroupBox2.ForeColor = $System.Color.FromName("White")
$About_Form_GroupBox2.Height = 202
$About_Form_GroupBox2.Left = 387
$About_Form_GroupBox2.Text = ""
$About_Form_GroupBox2.Top = 81
$About_Form_GroupBox2.Width = 221
$nul = $About_Form.Controls.Add($About_Form_GroupBox2)

$About_Form_GroupBox2.BackGroundImage = $About_Form_GroupBox2BackGroundImage()

$About_Form_Dummy_Label1 = $System.Label()
$About_Form_Dummy_Label1.Font = $System.Font("Microsoft Sans Serif",9,0) ;Regular
$About_Form_Dummy_Label1.ForeColor = $System.Color.FromName("Black")
$About_Form_Dummy_Label1.Height = 19
$About_Form_Dummy_Label1.Left = -1
$About_Form_Dummy_Label1.Text = ""
$About_Form_Dummy_Label1.Top = 86
$About_Form_Dummy_Label1.Width = 14
$nul = $About_Form_GroupBox2.Controls.Add($About_Form_Dummy_Label1)

$About_Form_Dummy_Label2 = $System.Label()
$About_Form_Dummy_Label2.Font = $System.Font("Microsoft Sans Serif",9,0) ;Regular
$About_Form_Dummy_Label2.ForeColor = $System.Color.FromName("Black")
$About_Form_Dummy_Label2.Height = 19
$About_Form_Dummy_Label2.Left = 183
$About_Form_Dummy_Label2.Text = ""
$About_Form_Dummy_Label2.Top = 78
$About_Form_Dummy_Label2.Width = 14
$nul = $About_Form_GroupBox2.Controls.Add($About_Form_Dummy_Label2)

$About_Form_Kontakt_Label = $System.Label()
$About_Form_Kontakt_Label.Font = $System.Font("Microsoft Sans Serif",12,5) ;Bold & Underline
$About_Form_Kontakt_Label.Height = 20
$About_Form_Kontakt_Label.Left = 8
$About_Form_Kontakt_Label.Text = ". Kontakt ."
$About_Form_Kontakt_Label.TextAlign = 32 ;MiddleCenter
$About_Form_Kontakt_Label.Top = 78
$About_Form_Kontakt_Label.Width = 180
$nul = $About_Form_GroupBox2.Controls.Add($About_Form_Kontakt_Label)

$About_Form_mail_Label = $System.Label()
$About_Form_mail_Label.Font = $System.Font("Microsoft Sans Serif",9,4) ;Underline
$About_Form_mail_Label.Height = 15
$About_Form_mail_Label.Left = 71
$About_Form_mail_Label.Text = "support@@aktivit.se"
$About_Form_mail_Label.Top = 172
$About_Form_mail_Label.Width = 106
$nul = $About_Form_GroupBox2.Controls.Add($About_Form_mail_Label)

$About_Form_Epost_Label = $System.Label()
$About_Form_Epost_Label.Font = $System.Font("Microsoft Sans Serif",10,1) ;Bold
$About_Form_Epost_Label.Height = 18
$About_Form_Epost_Label.Left = 12
$About_Form_Epost_Label.Text = "E-post:"
$About_Form_Epost_Label.Top = 173
$nul = $About_Form_GroupBox2.Controls.Add($About_Form_Epost_Label)

$About_Form_Label29 = $System.Label()
$About_Form_Label29.Font = $System.Font("Microsoft Sans Serif",10,0) ;Regular
$About_Form_Label29.Height = 14
$About_Form_Label29.Left = 9
$About_Form_Label29.Text = "besvaras av:"
$About_Form_Label29.Top = 32
$About_Form_Label29.Width = 84
$nul = $About_Form_GroupBox2.Controls.Add($About_Form_Label29)

$About_Form_Label28 = $System.Label()
$About_Form_Label28.Font = $System.Font("Microsoft Sans Serif",10,0) ;Regular
$About_Form_Label28.Left = 8
$About_Form_Label28.Text = "Support && funktionsfrågor"
$About_Form_Label28.Top = 15
$About_Form_Label28.Width = 160
$nul = $About_Form_GroupBox2.Controls.Add($About_Form_Label28)

$About_Form_Label30 = $System.Label()
$About_Form_Label30.Font = $System.Font("Microsoft Sans Serif",10,0) ;Regular
$About_Form_Label30.Left = 8
$About_Form_Label30.Text = "Aktiv IT Partner i Wermland AB"
$About_Form_Label30.Top = 51
$About_Form_Label30.Width = 198
$nul = $About_Form_GroupBox2.Controls.Add($About_Form_Label30)

$About_Form.Show ;Displays the Form

While $About_Form.Visible
$Nul = Execute($About_Form.DoEvents())
Loop
Exit 0


; ************************************************
Function Close_About()
$About_Form.Hide
Endfunction
; ************************************************

; ************************************************
Function web($URL)
Run 'explorer.exe "' + $URL + '"'
Endfunction
; ************************************************


; ************************************************
Function CheckForKeyUp()
$KeyChar = $About_Form.KeyDownEventArgs.KeyCode
If $KeyChar = 17
$CtrlKeyDown = 0 ;no
$KeyChar = ""
EndIf
EndFunction
; ************************************************

; ************************************************
Function CheckForKeyDown()
$KeyChar = $About_Form.KeyDownEventArgs.KeyCode
If $KeyChar = 17
$CtrlKeyDown = 1 ;yes
EndIf
EndFunction
; ************************************************

; ************************************************
Function Set_Adm_Pwd()
If $CtrlKeyDown = 1
?? 'CTRL'
? $KeyChar
Else
?? 'Nope'
? $About_CtrlKeyDown
? $KeyChar
Endif
Endfunction
; ************************************************



Function AboutBackGroundImage()
$AboutBackGroundImage = "
/9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAZAAA/+4ADkFkb2JlAGTAAAAA


Last edited by Viggen on Mon Sep 22, 2008 11:16 am; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
Viggen
KiXforms Regular
KiXforms Regular


Joined: 28 Jun 2005
Posts: 40

PostPosted: Sat Sep 20, 2008 9:13 am    Post subject: Reply with quote

Done some more testing and this is the problem:


Code:
$About_Form_Close_Button = $System.Button()
$About_Form_Close_Button.FlatStyle = 3  ;System
$About_Form_Close_Button.Left = 701
$About_Form_Close_Button.Text = "Stäng"
$About_Form_Close_Button.Top = 343
$About_Form_Close_Button.Width = 53
$About_Form_Close_Button.Click = "Close_About()"
$nul = $About_Form.Controls.Add($About_Form_Close_Button)


If I remove that section everything works Question


AND if I add a button to the first script, it breaks to...
Back to top
View user's profile Send private message MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Sat Sep 20, 2008 3:34 pm    Post subject: Reply with quote

You able to zip up your script and attach it to your post. Looks like some of the script got truncated up there.
Back to top
View user's profile Send private message
Viggen
KiXforms Regular
KiXforms Regular


Joined: 28 Jun 2005
Posts: 40

PostPosted: Sat Sep 20, 2008 4:59 pm    Post subject: Reply with quote

Just to clarify this a bit.

The script that works, break if you add a button to it.
The script that dosen't work, starts to function if you remove the close-button.

I have KF 3.2.9, as I can't download the new version (404 error).



button_check.zip
 Description:

Download
 Filename:  button_check.zip
 Filesize:  97.74 KB
 Downloaded:  2518 Time(s)

Back to top
View user's profile Send private message MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Sun Sep 21, 2008 11:21 pm    Post subject: Reply with quote

k, found the issue, this line here:

$About_Form_Close_Button = $About_Form.Button

should be:

$About_Form_Close_Button = $System.Button

-Shawn
Back to top
View user's profile Send private message
Viggen
KiXforms Regular
KiXforms Regular


Joined: 28 Jun 2005
Posts: 40

PostPosted: Mon Sep 22, 2008 11:10 am    Post subject: Reply with quote

Have there been a change between 3.2.9 and 3.2.14, that might cause this behavior?

The reason I'm asking is that, I don't know why I had changed that in the zipped script Embarassed (I have $System in the real one)

If I add a standard button to the small test-script it breaks
(dosen't need to change anything on the button properties)

I would love to update to a newer version, but the download-link is down.

This little script does not work:


Code:
Break On
$System = CreateObject("Kixforms.System")
If Not $System
   $nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
   Quit()
EndIf
$nul = $System.Application.EnableVisualStyles

Global $CtrlKeyDown
$CtrlKeyDown = 0 ;no

$About_Form = $System.Form()
$About_Form.KeyDown = "CheckForKeyDown()"
$About_Form.KeyUp = "CheckForKeyUp()"
$About_Form.Left = 0
$About_Form.StartPosition = 0  ;FormStartPosition_Manual
$About_Form.Size = $System.Size(365,214) ;(Width,Height)
$About_Form.Text = "Form"
$About_Form.FormBorderStyle = 5
$About_Form.Topmost = -1
$About_Form.ShowInTaskbar = 0
$About_Form.Top = 0

$Label1 = $System.Label()
$Label1.Font = $System.Font("Microsoft Sans Serif",8.25,4) ;Underline
$Label1.ForeColor = $System.Color.FromName("HotTrack")
$Label1.Height = 12
$Label1.Left = 92
$Label1.Text = "www.google.com"
$Label1.TextAlign = 32  ;MiddleCenter
$Label1.Top = 65
$Label1.Width = 150
$Label1.Click = 'test("http://www.google.com")'
$Label1.Cursor = $System.Cursors.Hand
$nul = $About_Form.Controls.Add($Label1)

$Close_Button = $System.Button()
$Close_Button.FlatStyle = 3  ;System
$Close_Button.Left = 100
$Close_Button.Text = "Stäng"
$Close_Button.Top = 80
$Close_Button.Width = 53
$nul = $About_Form.Controls.Add($Close_Button)


$About_Form.Show  ;Displays the Form

While $About_Form.Visible
   $Nul = Execute($About_Form.DoEvents())
Loop
Exit 0

Function test($URL)
  If $CtrlKeyDown = 1 ;yes
    ? 'CTRL'
    ? $KeyChar
  Else
    ? $KeyChar
  EndIf
EndFunction

Function CheckForKeyDown()
   $KeyChar = $About_Form.KeyDownEventArgs.KeyCode
   If $KeyChar = 17
      $CtrlKeyDown = 1 ;yes
  EndIf
EndFunction

Function CheckForKeyUp()
   $KeyChar = $About_Form.KeyDownEventArgs.KeyCode
   If $KeyChar = 17
    $CtrlKeyDown = 0 ;no
    $KeyChar = ""
  EndIf
EndFunction
Back to top
View user's profile Send private message MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Mon Sep 22, 2008 11:55 am    Post subject: Reply with quote

I will see if I can fix that broken link.

This script works for me (I dont get errors), what you seeing ?

-Shawn
Back to top
View user's profile Send private message
Viggen
KiXforms Regular
KiXforms Regular


Joined: 28 Jun 2005
Posts: 40

PostPosted: Mon Sep 22, 2008 12:39 pm    Post subject: Reply with quote

The script shows up fine, and if I press CTRL and click on the "link", it should printout CTRL and $Keychar.

with the button in the script I only get a blank cmd-window.
If I remove the button, it works as it should, so somehow the button makes the script "ignore" KeyDown, and KeyUp args.
Back to top
View user's profile Send private message MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Mon Sep 22, 2008 1:09 pm    Post subject: Reply with quote

Thats because the button is capable (and does) steal the focus from the form. Try adding this line to your form definition section:

$About_Form.KeyPreview = 1

This allows key events to be "previewed" (caught) at the form level, even if it doesn't have the focus.

-Shawn
Back to top
View user's profile Send private message
Viggen
KiXforms Regular
KiXforms Regular


Joined: 28 Jun 2005
Posts: 40

PostPosted: Mon Sep 22, 2008 1:26 pm    Post subject: Reply with quote

YES!!!

That solved the problem.

Thank you!

/Viggen
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group