|
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
|
|
|
|
|
do itin this way man...
when your form loads write button1.hide()..
and also mking visible property false is one more way...
bye..
have fun
|
|
|
|
|
try:
button1.visible = false
If that doesn't work you must be referencing the button before creating it.
Posted by The ANZAC
|
|
|
|
|
How do i go about Serialize an XML Node. I need to send it across a tier? Ive generated the XML Node. The class that creates the xmlnode is declared as Serializable_
|
|
|
|
|
Hi,
Use this form of code.
Dim ser As XmlSerializer = new XmlSerializer(GetType(XmlNode))
Dim myNode As XmlNode = <code>YOUR_XML_NODE</code>
Dim writer As TextWriter = new StreamWriter(filename)
ser.Serialize(writer, myNode)
writer.Close()
"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
coolestCoder
|
|
|
|
|
I have one form that is called "form1"
and when you click on the button "View Code" the other form called "code"
pops up each time you click on button with different tag on it.
So now i have 3 forms "code" and how can i find form that tag is "fire".
Thanks!!!
|
|
|
|
|
I'm not sure I follow, but you have a collection of all forms open on the Application object. You can also build your own collection, or use delegates to communicate between forms.
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 )
|
|
|
|
|
Uhhh.... What??
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: Uhhh.... What??
you just don't want to help me right?
<br />
Dim frm As Form<br />
For Each frm In My.Application.OpenForms<br />
<br />
If frm.Tag = FormCodeTag Then<br />
frm.Activate()<br />
end if<br />
<br />
Next<br />
|
|
|
|
|
FeRtoll wrote: you just don't want to help me right?
No, what your wrote made absolutely no sense what-so-ever, and I'm not the only one who said so.
Yes, I remember who you are and what you did...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
well then you know that i am from Croatia and my English is bad...
And what i did? i did nothing... it was the same as now!!! ^ you don't understand me well!!!
Sorry.
|
|
|
|
|
This...[^]
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am trying to create an order form for my users. The form has a listbox where the user selects multiple names and it populates a textbox for user confirmation. The selection process also creates an array used to create a SQL database record for each name in the list. This part works. Here is the code I have so far:
Sub xxx
reader1 = dr1.ExecuteReader()
While reader1.Read()
values1.Add(reader1.Item("Name"))
values2.Add(reader1.Item("Emplid"))
End While
lbName.DataSource = values1
lbEmplid.DataSource = values2
End Sub
Sub xxx
rtbName.Text = Nothing
rtbEmplid.Text = Nothing
For i = 0 To lbName.SelectedItems.Count - 1
With arrList2
.ToArray()
End With
rtbName.Text = rtbName.Text & lbName.SelectedItems(i) & vbCrLf
Next
i = Nothing
The problem I'm running into is, I need to collect the Emplid along with the name. I'm trying to set it up by selecting only the name with the Emplid selected at the same time. I can combine the two within the SQL statement, but I need to populate each field of the database entry separately.
Any help would be greatly appreciated.
Thank you,
LWhite
|
|
|
|
|
Larry White wrote: values1.Add(reader1.Item("Name")) values2.Add(reader1.Item("Emplid"))
I suspect you want to create a struct which connects these two values and build a collection of those structs.
Larry White wrote: With arrList2 .ToArray() End With
Why would you do this to call one method ?
Larry White wrote: lbName.SelectedItems
Items in a combobox can also have a value stored against them, you can store the Id there.
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 )
|
|
|
|
|
I am a relative beginner at VB.NET so my methods may be a little off. I am trying to pull the data from 2 fields from 1 table and creating a new record with name and employee id. I thought it would be a relatively simple process to capture an array with the name and ID, then use the array in the SQL insert variables to create each record.
Thank you for responding,
LWhite
|
|
|
|
|
OK, last question of the night.
Is there any way, so when the close button is pressed in the control box, that either:
a) A form is displayed (i have made a confirm exit screen)
or
b) The program is closed totally, including all hidden forms
|
|
|
|