|
its ok and fine...
the line in which u have modified should be having validated in place of validating coz controll is validated after the focus is off, like this
still e.cancel is not working and showing the error that cancel is not the member of system.eventarg but its ok...i'll rectify this part through my database, by dissaloving the user to insert blank value..
AddHandler ctrl.Validated,AddressOf txtvalidate_validating<br />
now its working working perfectly...
thanks...
-- modified at 17:14 Friday 16th March, 2007
|
|
|
|
|
The events fire in this order:
LostFocus
Validating
Validated
'Cancel' is not a property of the system.eventarg object which is the object the Validated event recieves. 'Cancel' IS a property of the System.ComponentModel.CancelEventArgs which is the object the Validating event recieves. I don't understand why you think the validation should occur in the validated event. There is no reason the validation shouldn't be done in the validating event and one very good reason why it should be. This reason would be that you can prevent other controls from responding to the user before they have inserted valid data. I'm glad you've got it working though. As long as it works the way you want I see no reason to change it.
|
|
|
|
|
Dear Friends,
I have ckecked list box in the form but it should work as a radio buton. the user can only select one option fom the checked list box.
How can I do it. Please help.
Thanx in advance.
Taher
|
|
|
|
|
then gofor combobox man
why to increase overhead and complexities...
|
|
|
|
|
Hello,
I have created a new insert procedure to insert a new incident record in the typed dataset designer in the datatable. I want to have the incidentID with is auto generated returned.
I have been playing around with the properties of the insert procedure, but can't find any way to return the incidentID number.
The code I have used for inserting is the following
<br />
INSERT INTO Incident (Company, CompanyID, Priority, Status, Subject, AssignedTo) VALUES (@Company,@CompanyID,@Priority,@Status,@Subject,@AssignedTo) SELECT @IncidentID = SCOPE_IDENTITY()<br />
The code for calling the insert is the following:
<br />
Me.TA_Incident_dsComponent_Equipment1.Insert(Me.cboCustomers.Text, Me.cboCustomers.SelectedValue, "Normal", "Not Started", Me.txtSubject.Text, Me.cboAssignIncident.SelectedValue)<br />
Many thanks with any help.
Steve
|
|
|
|
|
Are you using an SQL Server stored procedure and you want the row Id of the newly inserted record to the table?
Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'
|
|
|
|
|
Hi i have intime(08:45) and outtime(20:16)=>24 hours format...,
Now i want to calculate between the time how many hours and minutes like...,
Plz help me,i need that codes.........,
Regards,
Magi
|
|
|
|
|
if you are using VB.NET then try-----------
Dim intime As DateTime<br />
dim outtime as datetime<br />
<br />
Dim tspan As TimeSpan = outtime.Subtract(intime )
hope this will work.
Live life to the fullest
|
|
|
|
|
but how to assign that tspan value in one textbox?
Plz reply..........
Magi
|
|
|
|
|
Hi,
check this[^]
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
Its really helpfull for me,
thanks lot......,
Magi
|
|
|
|
|
Hi To All
I Need A Function Name (API) Than Can Make User Under Win NT Family. Localy & Remoot(Under Local Area Network).
I Can Make User ON Local Computer But I Want To Make User On Remote Computer; Can Any One Help Me?
Tanks.
Mogtabam
|
|
|
|
|
i have a little problem with my vb codes.After i click this button1 it gives me a result and after i tried again with other checkbox and radiobutton settings it gives the same result again
what should i have to do for reset the result after it shoves to me
my codes:
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
bos = 0
toplammaliyet = CInt(Ayarlar.TextBox1.Text * forma) + CInt(Ayarlar.TextBox2.Text * forma) + CInt(Ayarlar.TextBox3.Text * forma) + CInt(Ayarlar.TextBox4.Text * forma) + CInt(Ayarlar.TextBox5.Text * forma) + CInt(Ayarlar.TextBox6.Text * forma) + CInt(Ayarlar.TextBox7.Text * forma) + CInt(Ayarlar.TextBox8.Text * forma) + CInt(Ayarlar.TextBox17.Text * baskisayi) + CInt(Ayarlar.TextBox18.Text * baskisayi) + CInt(Ayarlar.TextBox15.Text * baskisayi) + CInt(Ayarlar.TextBox19.Text * baskisayi) + CInt(Ayarlar.TextBox20.Text * baskisayi) + CInt(Ayarlar.TextBox16.Text * baskisayi) + CInt(Ayarlar.TextBox21.Text * baskisayi) + CInt(bandrol * baskisayi) + CInt(ambalaj * baskisayi) + CInt(Ayarlar.cilt.Text * forma) + CInt(nakliye * baskisayi) + CInt(dizgi * forma) + CInt(kapak) + CInt(iccizim) + CInt(ozalit) + CInt(Ayarlar.rcilt.Text) + CInt(baski) + CInt(ressam) + CInt(ctp)
MsgBox("Bu Kitap için toplam Maliyet" + Str(toplammaliyet))
End Sub
|
|
|
|
|
alpdoruk wrote: what should i have to do for reset the result after it shoves to me
If toplammaliyet carries the result, therefore you should set 0 value for it to reset it. Use toplammaliyet as public variable inside the form and when you done with computing, just assign zero value to it.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Public toplammaliyet As Integer
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
bos = 0
toplammaliyet = 0
toplammaliyet = CInt(Ayarlar.TextBox1.Text * forma) + CInt(Ayarlar.TextBox2.Text * forma) + CInt(Ayarlar.TextBox3.Text * forma) + CInt(Ayarlar.TextBox4.Text * forma) + CInt(Ayarlar.TextBox5.Text * forma) + CInt(Ayarlar.TextBox6.Text * forma) + CInt(Ayarlar.TextBox7.Text * forma) + CInt(Ayarlar.TextBox8.Text * forma) + CInt(Ayarlar.TextBox17.Text * baskisayi) + CInt(Ayarlar.TextBox18.Text * baskisayi) + CInt(Ayarlar.TextBox15.Text * baskisayi) + CInt(Ayarlar.TextBox19.Text * baskisayi) + CInt(Ayarlar.TextBox20.Text * baskisayi) + CInt(Ayarlar.TextBox16.Text * baskisayi) + CInt(Ayarlar.TextBox21.Text * baskisayi) + CInt(bandrol * baskisayi) + CInt(ambalaj * baskisayi) + CInt(Ayarlar.cilt.Text * forma) + CInt(nakliye * baskisayi) + CInt(dizgi * forma) + CInt(kapak) + CInt(iccizim) + CInt(ozalit) + CInt(Ayarlar.rcilt.Text) + CInt(baski) + CInt(ressam) + CInt(ctp)
MsgBox("Bu Kitap için toplam Maliyet" + Str(toplammaliyet))
End Sub
so i make it like that but not working
|
|
|
|
|
ok i make it like that and now works..
thank you very much
Public toplammaliyet As Integer
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
bos = 0
toplammaliyet = CInt(Ayarlar.TextBox1.Text * forma) + CInt(Ayarlar.TextBox2.Text * forma) + CInt(Ayarlar.TextBox3.Text * forma) + CInt(Ayarlar.TextBox4.Text * forma) + CInt(Ayarlar.TextBox5.Text * forma) + CInt(Ayarlar.TextBox6.Text * forma) + CInt(Ayarlar.TextBox7.Text * forma) + CInt(Ayarlar.TextBox8.Text * forma) + CInt(Ayarlar.TextBox17.Text * baskisayi) + CInt(Ayarlar.TextBox18.Text * baskisayi) + CInt(Ayarlar.TextBox15.Text * baskisayi) + CInt(Ayarlar.TextBox19.Text * baskisayi) + CInt(Ayarlar.TextBox20.Text * baskisayi) + CInt(Ayarlar.TextBox16.Text * baskisayi) + CInt(Ayarlar.TextBox21.Text * baskisayi) + CInt(bandrol * baskisayi) + CInt(ambalaj * baskisayi) + CInt(Ayarlar.cilt.Text * forma) + CInt(nakliye * baskisayi) + CInt(dizgi * forma) + CInt(kapak) + CInt(iccizim) + CInt(ozalit) + CInt(Ayarlar.rcilt.Text) + CInt(baski) + CInt(ressam) + CInt(ctp)
MsgBox("Bu Kitap için toplam Maliyet" + Str(toplammaliyet))
toplammaliyet = 0
End Sub
|
|
|
|
|
Why? Is it giving you an error message? if it does, what is the error message. Are you sure the total is not exceeding the limits of INTEGER. You are saying the it is working okay, but your problem was how to reset the toplammaliyet variable and I showed you the way
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
no it workss now no error messages.
it's less then 65536 so for that reason i used integer
yes you showed me that i should add toplammaliyet=0 after the msgbox line
|
|
|
|
|
Why is 'toplammaliyet' a global variable? You seem to be using it in this case as a temporary variable. It should be declared with local scope.
|
|
|
|
|
Notting indicates that it is a temporary variable. He hasn't defined it inside the procedure that is why I assumed that he is using it as a global variable.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
I'm aware the variable was declared globally. To me it does appear temporary. However it may not be. My point is the OP gives it a value, displays the value and then sets it to zero. The variable itself may have another use somewhere else and perhaps for whatever reason it needs to be set to 0. In my opinion the variable shouldn't have been used to store the value just for display. He should have used a different variable which only has local scope to store the calculation. He can then display the result and if needed reset the global variable. I just think stuff like that tends to lead to headaches.
|
|
|
|
|
i will add somewhere else something in relation with it
|
|
|
|
|
This is a total disaster. What are you thinking ?
You can iterate over the controls collection of a form to sum the values in all the text boxes. A good first step is to give your controls meaningful names, however.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
It is me again! I am getting stuck with the same problem. There is button on the form (Button1). My aim is to change its visible property by use of controls
Me.Controls("Button1").Visible = False somewhere in the code. I am getting an error message saying "Use the new keyword to create an instance of the object"
Why do I have to create a new instance, because am trying to use controls which is globally addressing to an object. Any help or idea is appreciated.
Thanks.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
I would guess you are setting a control visible to false before it is created. You might need to add some code like:
if Not (Me.Controls("Button1") is Nothing) Then
You get the idea.
Hope that helps.
Ben
|
|
|
|