473,386 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Event Handling & f1 Key

Hi

Wondered if anyone can help with a couple of small
problems we are having.

Firstly, how do we check if someone has hit the F1 within
a TextBox field?

Secondly, we are having problem with handling events. We
have used the follwing code to track that a called screen
has been closed. What we also want is when a push button
is pressed to close the other form to perform the same
sub. We have tried using cat_lu.closed or or the push
button click-event but to no avail!

Dim Cat_Lu As New frmCat_Lu
AddHandler Cat_Lu.Closing, AddressOf Refresh_Cat
Cat_Lu.Show()

Any help would be gratefully received!

Regards

Martin

Nov 20 '05 #1
5 1598
Cor
Hi Martin,

Private Sub textbox1_KeyUp(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) Handles textbox1.KeyUp
If e.KeyCode = Keys.F1 Then
For the second problem you can look what a class with shared functions/subs
can do for you. You have than a lot of scennario's, keep track in that what
is the current form and also you can put that code from that sub in it
Secondly, we are having problem with handling events. We
have used the follwing code to track that a called screen
has been closed. What we also want is when a push button
is pressed to close the other form to perform the same
sub. We have tried using cat_lu.closed or or the push
button click-event but to no avail!


I hope this helps a little bit.

Cor
Nov 20 '05 #2
Hi Cor

Many thanks for the reply, your first answer works a
treat. Sorry but I didn't understand the second answer
probably because I am so new to vb.net. If you could
clarify it would be most appreciated.

Cheers

Martin

-----Original Message-----
Hi Martin,

Private Sub textbox1_KeyUp(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) Handles textbox1.KeyUp If e.KeyCode = Keys.F1 Then
For the second problem you can look what a class with shared functions/subscan do for you. You have than a lot of scennario's, keep track in that whatis the current form and also you can put that code from that sub in it
Secondly, we are having problem with handling events. We have used the follwing code to track that a called screen has been closed. What we also want is when a push button is pressed to close the other form to perform the same
sub. We have tried using cat_lu.closed or or the push
button click-event but to no avail!


I hope this helps a little bit.

Cor
.

Nov 20 '05 #3
Cor
Hi Martin,

Trying to track an event of an closing form is theoposite way in my eyes.

You know what you are doing, so when you open a form tell what form it is
somewhere. You can by instance make a class for this
\\\
Public class mySpecial
Private shared mlast as string
Public shared property MylastProgram
Get
Return pFormWidth
End get
Set (byval value as string)
mlast = value
end set
end property
Public Shared sub MartinSpecial ()
here I can do everything i want in all my programs
end sub
end class
///

In all the forms (classes) you can say
\\\
mySpecial.MylastProgram = X
or if mySpecial.mylastprogram = X etc
///
And you can do
\\\
mySpecial.MartinSpecial()
///

I hope this helps a little bit to bring you on that route?

Cor

Many thanks for the reply, your first answer works a
treat. Sorry but I didn't understand the second answer
probably because I am so new to vb.net. If you could
clarify it would be most appreciated.

Nov 20 '05 #4
Cheers Cor.

We will have a look at this and thank for your help.

Regards,

Martin

-----Original Message-----
Hi Martin,

Trying to track an event of an closing form is theoposite way in my eyes.
You know what you are doing, so when you open a form tell what form it issomewhere. You can by instance make a class for this
\\\
Public class mySpecial
Private shared mlast as string
Public shared property MylastProgram
Get
Return pFormWidth
End get
Set (byval value as string)
mlast = value
end set
end property
Public Shared sub MartinSpecial ()
here I can do everything i want in all my programs
end sub
end class
///

In all the forms (classes) you can say
\\\
mySpecial.MylastProgram = X
or if mySpecial.mylastprogram = X etc
///
And you can do
\\\
mySpecial.MartinSpecial()
///

I hope this helps a little bit to bring you on that route?
Cor

Many thanks for the reply, your first answer works a
treat. Sorry but I didn't understand the second answer
probably because I am so new to vb.net. If you could
clarify it would be most appreciated.

.

Nov 20 '05 #5
Cor
Hi Martin,

This is an error, typed it to much again whil I first was making two classes
with different names. Maybe there are more typo's but it is of course of the
idea how to do it.
Private shared mlast as string
Public shared property MylastProgram Public shared property mylastprogram as string Get
Return pFormWidth

Return mlast

Sorry

Cor
Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: DylanM | last post by:
I have some checkboxes that are generated from the results of a database search. At the moment, the checkboxes are part of a table making up a form. Users are going through the form, clicking the...
7
by: Pavils Jurjans | last post by:
Hallo, I have been programming for restricted environments where Internet Explorer is a standard, so I haven't stumbled upon this problem until now, when I need to write a DOM-compatible code. ...
1
by: Covad | last post by:
Hi all, For some reason my change() function is only called when the page loads. I'd much rather it gets called when the select changes. Here's the code: window.onload = init; function...
4
by: Eric | last post by:
How can I dynamically assign an event to an element? I have tried : (myelement is a text input) document.getElementById('myelement').onKeyUp = "myfnc(param1,param2,param3)"; ...
4
by: Thomas | last post by:
Hi there, I have an iframe which is editable (designMode = "on") and want to resize it dynamically as the content grows (e.g. more lines of text is in there) and there the struggle starts. I...
18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
8
by: Mark | last post by:
Hi, I'm looking for some ideas on how to build a very simple Event processing framework in my C++ app. Here is a quick background ... I'm building a multithreaded app in C++ (on Linux) that...
8
by: Nathan Sokalski | last post by:
I add a JavaScript event handler to some of my Webcontrols using the Attributes.Add() method as follows: Dim jscode as String = "return (event.keyCode>=65&&event.keyCode<=90);"...
44
by: Kulgan | last post by:
Hi I am struggling to find definitive information on how IE 5.5, 6 and 7 handle character input (I am happy with the display of text). I have two main questions: 1. Does IE automaticall...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.