473,569 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trouble understanding changesl from vb6 to .net ... how do you...

Hello:

What replaces "locking" a text or "combo" box so that input is not allowed?
Do not want to use disable.

How can you trap all keyboard input and set it equal to nothing?

Thanks

Terry
Nov 20 '05 #1
3 1471
Terry,
What replaces "locking" a text or "combo" box so that input is not allowed? Do not want to use disable
Try the .ReadOnly property.
How can you trap all keyboard input and set it equal to nothing?


Not quite sure I understand what you're trying to do here. If developing a
windows form you can capture the keypress event. Something like the
following:

Private Sub frmMyForm_Load( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
AddHandler somecontrol.Key Press, AddressOf CheckMyKeyPress
End Sub

Private Sub CheckMyKeyPress (ByVal sender As System.Object, _
ByVal e As System.Windows. Forms.KeyPressE ventArgs)

Select Case Asc(e.KeyChar)
Case AscW(ControlCha rs.Cr) 'Enter key
txtStatus.Text = "You Pressed The Enter Key"
Case Else ' Everything else
Exit Sub
End Select
End Sub

HTH,

Raymond Lewallen
Nov 20 '05 #2
Terry,
What replaces "locking" a text or "combo" box so that input is not allowed? Do not want to use disable
Try the .ReadOnly property.
How can you trap all keyboard input and set it equal to nothing?


Not quite sure I understand what you're trying to do here. If developing a
windows form you can capture the keypress event. Something like the
following:

Private Sub frmMyForm_Load( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
AddHandler somecontrol.Key Press, AddressOf CheckMyKeyPress
End Sub

Private Sub CheckMyKeyPress (ByVal sender As System.Object, _
ByVal e As System.Windows. Forms.KeyPressE ventArgs)

Select Case Asc(e.KeyChar)
Case AscW(ControlCha rs.Cr) 'Enter key
txtStatus.Text = "You Pressed The Enter Key"
Case Else ' Everything else
Exit Sub
End Select
End Sub

HTH,

Raymond Lewallen
Nov 20 '05 #3
In the event for keypress, you can set e.Handled = True, and the keypress will be ignored. If you want this to apply to the whole form (which would prevent any keyed input) you could set the key preview for the form to true and use something like the following

frm_Keypress(By Val e as KeyPressEventAr gs) Handles ..etc.
e.Handled = Tru

Nov 20 '05 #4

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

Similar topics

0
3017
by: Weston C | last post by:
I'm having some trouble with Mail_Mime... it looks as if it isn't handling the creation of headers transparently. Here's what I'm essentially doing: $MimeMesg = new Mail_mime(); $MimeMesg->setTxtBody($MessageBody); $MimeMesg->setHTMLBody($filledInTemplate); $MimeMesg->addHTMLImage($entry,'image/jpeg'); $headers = array( 'From' =>...
2
2574
by: Freddie | last post by:
Hi, I've been mangling python-irclib into an asyncore class, so it fits in nicely with the rest of my app. I ran into a problem with asyncore.dispatcher_with_send (Python 2.3.4), though. Not sure if this is the right place to file a bug, but here goes: class dispatcher_with_send(dispatcher):
7
1501
by: CheGueVerra | last post by:
First of all Hello all you css freak. geeks and gurus. I just started using css for some web pages I had to do at work and I'im testing some stuff at home to understand more. Now, I wanted to understand better of how cascading works. in my .css file I created this tr#noLine{ border-top-width:0; border-left-width:0;
1
2123
by: don | last post by:
I'm trying to import a comma delimited text file into MS Access 2002 version - the first column is set for an auto increment primary key and everything works right the first time I import a text file, however when I try to append to this new database table Access always messes up the import - as long as I ieave the auto increment column out it...
5
2503
by: Krumble Bunk | last post by:
Hello! First things first (but not necessarily in that order), this is a really great group, and has helped me understand more and more C everytime I read the postings, so thanks for a great learning environment! I am having difficulty understanding this bitwise macro (i've recently moved into working on these, using OpenSolaris source...
6
1896
by: Hypo | last post by:
Im relatilvly new to a web programming in general, and here's the situation i have: I have a default page with dynamic content, and one button with onclick code something like this: { // do some processing... Serever.Transfer("second_page.aspx"); // or Response.Redirect("second_page.aspx"); same in
9
2369
by: Greg Linwood | last post by:
I'm having difficulty understanding Session state in ASP.Net. It's almost embarrassing asking this as I've been using ASP since it was first released & it really shouldn't be this hard to use - perhaps I'm just not very smart or perhaps MS is making this too hard for us sql bunnies to understand - I dunno, but I'd really appreciate someone...
6
3773
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for one day): \\FFDS24\ASP.NET Applications(_LM_W3SVC_1_Root_ATV2004)\Errors During Execution: 7 \\FFDS24\ASP.NET Apps...
2
1554
by: rubikzube* | last post by:
I'm new to mysql and I was wondering if I could trouble some of you for help. I have a table in my database that may contain multiple versions of the same element as different rows. I wanted to use the following query to group the rows by element with "group by" and then use the "having" to get the most recent version of each element,...
1
1217
by: sndive | last post by:
i have a lot of trouble selling twisted a a client lib for network access (on embedded platform) the group i'm a member of wants to write some unmaintainable threaded blocking junk in c--. does anyone can give me an idea how many kilobytes extra would it take to have a pyqt linked in and a running qtreactor? (qtreactor natirally depends on...
0
7695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
0
7922
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8119
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.