473,466 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

form's method problem

In my system,every form needs to check the right first, if it return false,
the myInvform should not process 'newclick'. How can I do that ?, I write
the following codes, it seems wrong.

---------------------------------
in myBaseform,
Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnNew.Click
If check_right = false Then
MessageBox.Show("U are no right to access !", "Error Message - New Doc",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
exit sub
End If
End Sub

in myInvform , [Which is inherited myBaseForm]
Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnNew.Click
Me.stdSB_screenmode.Text = "NEW"
Me.txtCompanyCode.setfocus
end sub
--------------------------------------------------------------
Nov 21 '05 #1
3 870
It looks like you have overridden the Sub btnNew_Click in myInvForm - so
only your new implementation will execute from myInvForm. You could call:
MyBase.btnNew_Click before your new implementation to fix this.

Hope this helps.

"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:uf**************@TK2MSFTNGP11.phx.gbl...
In my system,every form needs to check the right first, if it return false, the myInvform should not process 'newclick'. How can I do that ?, I write
the following codes, it seems wrong.

---------------------------------
in myBaseform,
Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnNew.Click
If check_right = false Then
MessageBox.Show("U are no right to access !", "Error Message - New Doc",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
exit sub
End If
End Sub

in myInvform , [Which is inherited myBaseForm]
Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnNew.Click
Me.stdSB_screenmode.Text = "NEW"
Me.txtCompanyCode.setfocus
end sub
--------------------------------------------------------------

Nov 21 '05 #2
Note that if you use MyBase.btnNew_Click, then BOTH the implementations will
execute, so this will be functionally incorrect, but should explain why the
problem was occurring.

Hope this helps.

"Matt S" <ma**@toomuchspamalready.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
It looks like you have overridden the Sub btnNew_Click in myInvForm - so
only your new implementation will execute from myInvForm. You could call:
MyBase.btnNew_Click before your new implementation to fix this.

Hope this helps.

"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:uf**************@TK2MSFTNGP11.phx.gbl...
In my system,every form needs to check the right first, if it return

false,
the myInvform should not process 'newclick'. How can I do that ?, I write the following codes, it seems wrong.

---------------------------------
in myBaseform,
Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnNew.Click
If check_right = false Then
MessageBox.Show("U are no right to access !", "Error Message - New Doc",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
exit sub
End If
End Sub

in myInvform , [Which is inherited myBaseForm]
Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnNew.Click
Me.stdSB_screenmode.Text = "NEW"
Me.txtCompanyCode.setfocus
end sub
--------------------------------------------------------------


Nov 21 '05 #3
* "Agnes" <ag***@dynamictech.com.hk> scripsit:
In my system,every form needs to check the right first, if it return false,
the myInvform should not process 'newclick'. How can I do that ?, I write
the following codes, it seems wrong.

---------------------------------
in myBaseform,
Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnNew.Click
If check_right = false Then
MessageBox.Show("U are no right to access !", "Error Message - New Doc",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
exit sub
End If
End Sub

in myInvform , [Which is inherited myBaseForm]
Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnNew.Click
Me.stdSB_screenmode.Text = "NEW"
Me.txtCompanyCode.setfocus
end sub
--------------------------------------------------------------


\\\
RemoveHandler Me.Button1.Click, AddressOf MyBase.Button1_Click
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #4

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

Similar topics

7
by: Rui Pestana | last post by:
Hello all, I want to use the POST method to submit the form and then grab the parameters in the asp file with request.form("parm"). The problem is that I am using the _search target to open...
5
by: Paxton | last post by:
I created an html email containing a form whose method is POST. The form is posted to an asp page for processing, but no values are retrieved. So I response.write all the Request.Form fields, and...
2
by: Asad | last post by:
I have a form on a page that has several textareas, and textboxes inside a table (so the table containing the textboxes is also inside the FORM tag). I want to replace the textareas with simple...
4
by: Stuart Perryman | last post by:
Hi, I have the following code which works just fine in IE6 but not in Firefox. It is an extract of several table rows each with an individual form. It is generated by php. <form...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
6
by: nadeem_far | last post by:
Hello All, I am working on a .Net desktop application and I am having problem displaying a form. I am using C# and version 1.1 of the framework. here is how the code looks likes and I will...
22
by: Zytan | last post by:
I have public methods in a form. The main form calls them, to update that form's display. This form is like a real-time view of data that is changing. But, the form may not exist (it is...
3
by: bsturg21 | last post by:
Hello, I have a windows form that has a series of linklabels on it, and I need to have each linklabel, when clicked, open a separate windows form that has a single paramter passed into it. The...
7
xNephilimx
by: xNephilimx | last post by:
lHi guys! I'm having a little problem that's getting on my nerves, I couldn't find a solution, I also tryed googling it and I found nothing... (my field of expertise is in AS 2 and 3, but I still...
4
by: Harlequin | last post by:
I have a question concerning the need to trigger events within a "child" subform which is itself enbedded within a master "parent" form and which is accessible via a tab in the parent form. Becuase...
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
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
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...
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
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.