|
|
I've browsed through dozens of posts on this subject, tried downloading some sample databases of which none worked, and tried to paste some codes into my test project, but I've not been able to figure out how to get a currency conversion value into my textbox.
Can anyone try to explain to me in a simple step by step process how to do the following:
My "form1" form has a button "button1" and two text boxes: "textbox1" contains the start currency value (e.g. in USD) and "textbox2" should display upon clicking the button1, the corresponding value in EUR.
I've added a Service Reference to my project with website: "http://www.webservicex.net/CurrencyConvertor.asmx"
Any assistance is highly appreciated. Once I can do one value, I can modify it to whatever I want.
Thanks!
Wouter
|
|
|
|
|
Dim conversionRate As Double = 0.0
Dim currencyService As New CurrencyConvertorSoapClient("CurrencyConvertorSoap")
conversionRate = currencyService.ConversionRate(Currency.USD, Currency.EUR)
Console.WriteLine("The conversion rate for USD to EUR is: {0}", conversionRate)
Console.WriteLine("$100.00 = {0} Euros", 100 * conversionRate)
Why was this so hard?? The only thing I can see that would be that hang up is the name of the endpoint ("CurrencyConvertorSoap"), which can be obtained by looking in your app.config file under <system.servicemodel><bindings>.
|
|
|
|
|
I got an error and i have tried so many ways to solve it..but still got error..
my table have 3 columns.. SID(autonumber), movieid(text),seat(text)..
i want to store splitword(1) into movie ID and for the rest splitword(i) where i = 3 , 4 ,5 6 and so on..... store in seat columns with new row..
sorry for bad english..
this is my code:
Dim index As Integer = 2
Dim testsplit As String = "Book 9 j18 d7 d8 a9"
Dim SplitWord() As String = testsplit.Split(" ")
Dim wc As Integer = SplitWord.Length - 1
Do While index <= wc
SeatNewRow.Item("MovieID") = SplitWord(1)
SeatNewRow.Item("Seat") = SplitWord(index)
SeatDS.Tables("Seat").Rows.Add(SeatNewRow)
index += 1
Loop
SeatDA.Update(SeatDS, "Seat")
modified 9-May-12 13:20pm.
|
|
|
|
|
Your code isn't adding new rows, you're modifying existing rows. Well, at least the code you posted. We can't see the code where you create this new row. Where is SeatNewRow being created??
|
|
|
|
|
actually this is only some part of the code..
I have table name Seat..in the table have 3 columns named SID, MovieID and Seat.
Actually i want to save the the word to the tables..
Splitword(1) to the MovieID column..
Splitword(2),splitword(3) and so on in the column "seat" with same value Splitword(1) on movieID.
The code as below..but i got "This row is already belongs to this table"..so, what should i do??
Dim SeatNewRow As DataRow
Dim index As Integer = 2
Dim testsplit As String = "Book 9 j18 d7 d8 a9"
Dim SplitWord() As String = testsplit.Split(" ")
SeatNewRow = SeatDS.Tables("Seat").NewRow()
Dim wc As Integer = SplitWord.Length - 1
Do While index <= wc
SeatNewRow.Item("MovieID") = SplitWord(1)
SeatNewRow.Item("Seat") = SplitWord(index)
SeatDS.Tables("Seat").Rows.Add(SeatNewRow)
index += 1
Loop
SeatDA.Update(SeatDS, "Seat")
..
|
|
|
|
|
You have to put the call to .NewRow() INSIDE the Do While loop, not outside of it. You have to create a new row object for every row you add. You cannot reuse the same object for the reason the error message gave you. You already added it!
|
|
|
|
|
So it is i need modified my code as below???i will try it now..
Dim SeatNewRow As DataRow
Dim index As Integer = 2
Dim testsplit As String = "Book 9 j18 d7 d8 a9"
Dim SplitWord() As String = testsplit.Split(" ")
Dim wc As Integer = SplitWord.Length - 1
Do While index <= wc
SeatNewRow.Item("MovieID") = SplitWord(1)
SeatNewRow.Item("Seat") = SplitWord(index)
SeatNewRow = SeatDS.Tables("Seat").NewRow()
SeatDS.Tables("Seat").Rows.Add(SeatNewRow)
index += 1
Loop
SeatDA.Update(SeatDS, "Seat")
|
|
|
|
|
problem solved....thanx so much...!!!
the solved code is as below:
Dim SeatNewRow As DataRow
Dim index As Integer = 2
Dim testsplit As String = "Book 9 j18 d7 d8 a9"
Dim SplitWord() As String = testsplit.Split(" ")
Dim wc As Integer = SplitWord.Length - 1
Do While index <= wc
SeatNewRow = SeatDS.Tables("Seat").NewRow()
SeatNewRow.Item("MovieID") = SplitWord(1)
SeatNewRow.Item("Seat") = SplitWord(index)
SeatDS.Tables("Seat").Rows.Add(SeatNewRow)
index += 1
Loop
SeatDA.Update(SeatDS, "Seat")
|
|
|
|
|
I use this code to add a custom control to a panel :
Dim usc As New InvoiceCTRL
usc.Top = y
usc.Left = 20
Me.Panel1.Controls.Add(usc)
y = y + 20
when the panel is filled & scroll bar appears,
the added controls appear very distant from each other.
i figured out thats because y is measured from THE Appearing Area of the panel not from the virtual top
is there a solution so the added controls appear uniformly separated from each other ??
all right,
i used a flowlayoutpanel instead,it worked,
modified 9-May-12 4:45am.
|
|
|
|
|
Location is an offset from 0,0 in the client area of the form, not the visible area of the client area of the form. The scroll bars have nothing to do with the placement of controls so there's something else going on that we can't see in your code.
|
|
|
|
|
How can I obtain the sender object from a control handle in VB.net?
I have a function GetProperties(sender)
sender is an Object Type like the one in Form1_Click sited below:
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
Form2.GetProperties(sender)
Form2.Show()
End Sub
Private Declare Function apiGetForegroundWindow Lib "user32" Alias "GetForegroundWindow" () As Int32
I currently can get a handle of a window or of a control that I clicked on as follows:
hwnd = apiGetForegroundWindow ()
How can I obtain the sender object from hwnd so that I can passed into GetProperties as follows: GetProperties(sender)?
Thanks,
|
|
|
|
|
handler huh? how about this[^]
|
|
|
|
|
Thank you so much replying and help. However, this is not exactly what I am looking for. I was trying to find a way to obtain the system of the item that I got the handle for.
For example, public sub button1_click (sender as Object, e As Args)
end sub
For example, public sub button2_click (sender as Object, e As Args)
end sub
For example, if the user click on button or any control, after I obtain the handle of the control being clicked I want to be able to trace back or obtain the sender of the handle.
hwnd = getHandle(button1)
I am trying to find a way to obtain the sender of hwnd so that I can pass the sender into a function whose parameter requires sender object, for example,
SenderObject = getSender(hwnd) 'How do I get the Senderobject from a control or a window hwnd so
that I can pass it into a function or sub that means to accept sender object as follows?
Call Button2_Click(SenderObject, e)
Thanks,
|
|
|
|
|
Only controls have handles. Cast your sender-object to a control, and you can access the property.
What is it that you're trying to achieve?
Bastard Programmer from Hell
|
|
|
|
|
Thank you very much for your info and help.
I have am trying to obtain all the properties of any window, control, or object that the user will click on.
I am currently, have function that accepts a sender and displays all the sender's properties.
For example, if the user clicked on button1,
in
Sub Button1_click(sender As Object, e As args)
GetProperties(sender) ' Right now I can do
' this fine.
End Sub
I can also do GetProperties(Me.ActiveControl) fine too.
However, when the user clicks on a window or a button of another application, I can obtain the handle of this window or this button as buttonhandle or windowhandle; however, I cannot pass windowhandle or buttonhandle directly into GetProperties as
GetProperties(windowhandle or buttonhandle) this does not work because GetProperties requires sender argument to be passed into it as follow GetProperties(getSender(windowhandle) or getSender(buttonhandle))
How do I get SenderObject = getSender (windowhandle) from windowhandle or
SenderObject = getSender (windowhandle) from windowhandle
so that I can pass it into GetProperties(SenderObject)?
Thanks,
|
|
|
|
|
Member 3746076 wrote: How do I get SenderObject = getSender (windowhandle) from windowhandle so that I can pass it into GetProperties(SenderObject)?
You can't. The other app might be using a custom treeview that your app doesn't know anything about.
No, won't work if you're looking at another process. What you're trying to achieve can be found here[^], with sourcecode.
Bastard Programmer from Hell
|
|
|
|
|
Thank you so much replying and help. However, this is not exactly what I am looking for. I was trying to find a way to obtain the sender object of the item that I got the handle for.
I am trying to obtain all the properties of any obeject that the user clicks on.
Currently, I can alread obtain the handle of the oject or of the control being clicked on, but I do not how to trace the handle back to its sender type or object.
For example, public sub button1_click (sender as Object, e As Args)
end sub
For example, public sub button2_click (sender as Object, e As Args)
end sub
For example, if the user click on button or any control, after I obtain the handle of the control being clicked I want to be able to trace back or obtain the sender of the handle.
hwnd = getHandle(button1)
I am trying to find a way to obtain the sender of hwnd so that I can pass the sender into a function whose parameter requires sender object, for example,
SenderObject = getSender(hwnd) 'How do I get the Senderobject from a control or a window hwnd so
that I can pass it into a function or sub that means to accept sender object as follows?
Call Button2_Click(SenderObject, e)
Thanks,
|
|
|
|
|
how can i code a datagridview with 3 columns:
textbox-textbox-combobox
textbox1 has an autocomplete collection;
when i select or type a string of it a matching number appear in textbox2;
and editing textbox2 affects the combobox's selected index ??
also how to make pressing enter moves to the first cell in the new row ??
|
|
|
|
|
The best solution for this would be to research using Google. However two URL's you may wish to review are....
http://www.dotnetperls.com/datagridview-vbnet
http://vb.net-informations.com/datagridview/vb.net_datagridview_tutorial.htm
|
|
|
|
|
Thanks,
I found a really helpful tutorial here :
http://www.codeproject.com/Articles/26289/Editable-and-Multi-Functional-Datagridview
|
|
|
|
|
I have a combobox attached to a database with names in it. How do I get the combolist to show only the name of the text typed as it is type. IE: If I type "A" I want the list to display only the names that start with the letter "A". I was able to do this in the VB6 but lost the function when I upgraded to Visual
Studio 2010.
Please help!!!!
cjscs
|
|
|
|
|
Not to hard to add the functionality.
Have a start here[^].
|
|
|
|
|
The AutoComplete functionality Jorgen links you to is nice. But you might be asking for a simple way to filter your list items (which could be used in conjunction with AutoComplete). Have a look at the BindingSource class and its Filter property. Something like this:
Dim bs As New BindingSource
bs.DataSource = dtTable
Me.ComboBox1.DataSource = bs
Me.ComboBox1.DisplayMember = "DISPLAY_COLUMN"
Private Sub ComboBox1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress
bs.Filter = "DISPLAY_COLUMN LIKE '" & e.KeyChar & "%'"
End Sub
|
|
|
|
|
description:
Custom screensaver in vb.net 2008 of a slideshow using local resource images embedded. I got the exe working fine.
general steps done so far:
1) form properties to no border and full screen
2) import images to local resources so they are embedded in the application
3) create a timer to change the form.background to the next image
4) generate a random number reflecting the number of images and confirm no repeats
5) close application trigger (spacebar)
6) test on my systems and work fine as exe
Problem:
#1
Within install shield reg settings pushed
-1 HKCU/controlpanel/dekstop/ScreenSaveActive = 1
-2 ScreenSaveTimeOut = 900 (15 minutes)
-3 SCRNSAVE.EXE = C:\Windows\MICHAE~1.SCR
1 and 3 work
2 doesn't set the screensaver timer to 15 minutes, it stays at the same timer previously entered
#2
right clicking on the desktop of Win 7 and selecting Personalize. The screensaver is there, but clicking on Screen Saver to open up the screensaver properties, the screensaver initiates. Stopping the screensaver brings the screensaver properties up fine. Using another way like Control Panel > Appearance and Personalization > Change screen saver works as expected. Using the start>run "screensaver" to open screensaver properties starts the screensaver and after closing the screensaver, the screensaver properties is available.
#3
in the screensaver properties, selecting either settings or preview start the screensaver twice. In other words, the screensaver will start, then after you close it, it starts again a second time.
#4
although the screensaver shows it is in the screensaver properties window. even after waiting the designated time to pass, the screensaver doesn't initiate.
Can someone lend a hand on how to resolve these issues?
www.MichaelHulak.com
modified 7-May-12 1:36am.
|
|
|
|