473,408 Members | 2,888 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,408 software developers and data experts.

Inherited TextBox control

Hello:

I'm trying to build a custom inherited control that changes location and
size on the screen when the user presses F1 and returns to it's original
size and location when the user presses ESC but I can't figure out what
fires when the control loads.

This worked with a user control but that has a load even that alows me to
store the original location in a variable.

Dim OrigLoc As Point
Protected Overrides Function ProcessDialogKey(ByVal keyData As Keys) As
Boolean
MyBase.ProcessDialogKey(keyData)

If keyData = Keys.F1 Then
OrigLoc = Me.Location
Me.Location = New Point(0, 0)
Me.Size = New Size(686, 326)
PopText.Size = New Size(686, 326)
End If
If keyData = Keys.Escape Then
Me.Size = New Size(450, 20)
Me.Location = OrigLoc
End If
End Function

TIA

Ralph
Nov 21 '05 #1
1 1389
Bob
Ralph:

Hmmm. I tried to replicate your issue but it seemed to work fine for me.

Sometimes things have to be refreshed.

Remove the control from you form and from your customize toolbox list, Close
both your control project and your destination project. Delete the
popuptextbox.dll and popuptextbox.pdb file from the bin folder in your
destination project. Readd the control to your Cutomize toolbox list and add
it to your form in your destination project. It should work

I even took the liberty of modifyinh your control so that it will also
return to it's original size when ESC is pressed

Dim OrigLoc As Point
Dim OrigSize As Size
Protected Overrides Function ProcessDialogKey(ByVal keyData As Keys) As
Boolean
MyBase.ProcessDialogKey(keyData)
If keyData = Keys.F1 Then
OrigLoc = Me.Location
OrigSize = Me.Size
Me.Location = New Point(0, 0)
Me.Size = New Size(686, 326)
End If
If keyData = Keys.Escape Then
Me.Location = OrigLoc
Me.Size = OrigSize
End If
End Function

Hope this helps

Bob
Nov 21 '05 #2

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

Similar topics

2
by: ad | last post by:
I have a base form, there a textbox on it, I set the textbox to protected. The properties of the textbox can't be modified when I inherited a form from the base form. I want to...
0
by: Frnak McKenney | last post by:
I'm running into problems with VisualStudio.NET2003 and Windows Forms inheritance. It _feels_ like a bug, but it could just as well be a misunderstanding on my part regarding how the VS Designer...
14
by: Graham Blandford | last post by:
Hi there, A quickie I think... If I create a new class that inherits the values of a windows form component class, can there ever be a visual representation of this in the .Net IDE? E.g. if...
2
by: Mac via DotNetMonster.com | last post by:
Hi all, I have created my own class DateBox which inherits from the System.Windows. Forms.TextBox class. In this DateBox class I catch the validating event so that I can run some code to...
7
by: Mike9900 | last post by:
I am inheriting from a text box control and does not want the client see some of the methods be invisible to the clients. Mike
0
by: Tony Johansson | last post by:
Hello! I have a very specific question and that is about how to inherit a visual control for example the control System.Windows.Forms.TextBox without causing the environment to delete the...
0
by: MikeY | last post by:
Hi everyone, I posted a question very early today, but maybe I wasn't articulate enough. Hopefully this will illicit a response I've created a windows form and a User Control. This is a...
0
by: Mark | last post by:
I want to create a user control inherited from a TextBox with an associated label (let's call it a LabelTextBox). The trick is that I want the control to inherit from TextBox and have all of its...
0
by: baburc | last post by:
Hai I have inherited one datagridview control as custom control and i have added one textbox control on it, when i write code in textbox's keypress or keydown event , this event doesn't raises...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.