vb.net - Showing IP address on Textbox after select combobox -
i want show ip address on textbox after select network adapter combobox list. working code showing adapter list on combobox.
dim ni = system.net.networkinformation.networkinterface.getallnetworkinterfaces dim niethernet = ni.where(function(x) x.networkinterfacetype = net.networkinformation.networkinterfacetype.ethernet) combobox1.datasource = niethernet.select(function(x) x.name).tolist()
i have no problem in selecting adapter. problem want textbox show ipv4 address depends on adapter take combobox list. how can that?
in selectedindexchanged event, based on combobox selected item:
private sub combobox1_selectedindexchanged(sender system.object, e system.eventargs) handles combobox1.selectedindexchanged 'will set textbox selected item in combobox textbox1.text = combobox1.selecteditem 'or set based on combo selection select case combo1.selecteditem case "local connection" textbox1.text = "some ip address" case "something else" textbox1.text = "something else" end select end sub
vb.net combobox textbox ipv4
No comments:
Post a Comment