|
How can I have the text of the selected Item from listivew by enter key?
Using vb.net 2005
Thanks In advance
|
|
|
|
|
insert a keydown-event for your listview.
then check e.keys for enter-key and when enter is pressed, pick out your listview's selected item and convert it to a string. then you have your selected item's text.
|
|
|
|
|
Hi,
I have 2 forms.On main form I have a listview and a button to add the customer in the listview.
On clicking the add customers button a new form opens up with a gridview with all the customers.Now what I want is that when user select multiple customers from the gridview and click ok button on customers list form then the selected customers from gridview should be added in the listview.
Thanks in advance
|
|
|
|
|
How about this:
<br />
dim v as integer<br />
For v = 0 To DataGridView1.SelectedCells.Count - 1<br />
ListView1.Items.Add(DataGridView1.SelectedCells(v).Value)<br />
Next v<br />
Good Luck.
|
|
|
|
|
I am working in VB.NET. I have a probelm regarding changing the System/Computer TimeZone from the VB.NET code. Is it possible with VB.NET code and how can we do this?
Thanks
Azmat Ullah
|
|
|
|
|
Me.OracleInsertCommand1.Parameters.AddRange(New System.Data.OracleClient.OracleParameter() {New System.Data.OracleClient.OracleParameter(":ADDBY", System.Data.OracleClient.OracleType.VarChar, 30, "ADDBY"),etc...
I'm using VS 2005 and it says AddRange doesn't belong the ParametersCollection.
But this is generated code from VS! (possibly 2003, we upgraded)
Can someone with 2003 check if it was valid in that version?
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
Me.OleDbInsertCommand1.Parameters.AddRange is a valid method apparently.
So the problem could be with the Oracle library?
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
I want to display a webpage on a windows form. And gradually i want to iterate and display several webpages on it. Also i need to do something when a particular webpage completes download to the window.
Can anybody please advise how can i achieve this using windows forms in vb.net 2005. I used WebBrowser control but it doesn't allows me to specify a url address through coding, but if I set the URL property to a site address at design time then it displays the site when the form loads.
Thanks in Advance. Please Help.
Sekhar
|
|
|
|
|
SekharOne wrote: I used WebBrowser control but it doesn't allows me to specify a url address through coding
Yes it does, try :-
WebBrowser1.Url = New System.Uri("http://www.google.co.uk")
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'
|
|
|
|
|
Thanks Steven
that worked.
Thanks a lot once again. You people are simply Great.
Sekhar
|
|
|
|
|
Is there is any way to format textbox for numeric values without using databinding?
Thanks In advance
Ejaz
|
|
|
|
|
Create a new class called NumericBox and inherit Windows.Forms.TextBox
Now all you need to do is intercept keypresses with the KeyPress event, and validate them, for example :-
Private Sub NumericBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress<br />
Dim KeyAscii As Integer<br />
<br />
KeyAscii = Asc(e.KeyChar)<br />
<br />
Select Case KeyAscii<br />
Case 8, 13 ' backspace and carriage return<br />
'Do nothing as the input is valid<br />
Case 48 To 57 ' Keys 0 to 9 <br />
'Test the number of decimal places<br />
If Me.Text.Contains(".") Then<br />
If (Me.Text.Trim.Length - InStr(Me.Text, ".")) >= DecimalPlaces Then KeyAscii = 0<br />
End If<br />
<br />
'Test to see if the new value will exceed the maximum value<br />
'or minimum value limits<br />
Dim sValue As String = Value.ToString<br />
Dim dValue As String<br />
sValue &= e.KeyChar<br />
dValue = CType(sValue, Decimal)<br />
If dValue < Minimum Or dValue > Maximum Then KeyAscii = 0<br />
<br />
'Do nothing as the input is valid<br />
Case 45 'minus sign<br />
If AllowNegativeValues Then<br />
'If negative values as permitted then...<br />
If Me.Text.Contains("-") Then<br />
'if we already have a minus sign then throw away this minus sign keystroke just pressed<br />
KeyAscii = 0<br />
End If<br />
<br />
If Me.SelectionStart <> 0 Then<br />
'If the insertion point is not sitting at zero (the beginning of the field),<br />
'throw away the minus sign<br />
KeyAscii = 0<br />
End If<br />
Else<br />
KeyAscii = 0<br />
End If<br />
<br />
Case 46 'decimal point<br />
If AllowDecimalPoint Then<br />
If Me.Text.Contains(".") Then<br />
KeyAscii = 0<br />
End If<br />
Else<br />
KeyAscii = 0<br />
End If<br />
<br />
Case Else<br />
'Any other input is invalid so throw it away<br />
KeyAscii = 0<br />
End Select<br />
<br />
If KeyAscii = 0 Then<br />
Beep()<br />
e.Handled = True<br />
Else<br />
e.Handled = False<br />
End If<br />
<br />
End Sub
The snippet above utilises additional properties I have added to my NumericBox, should as AllowNegativeValues and AllowDecimalPoints both of which are Boolean values
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'
|
|
|
|
|
This works unless the user is allowed to paste into the textbox...
If you're rolling your own numeric textbox, then you have to look at the TextChanged event and validate the contents on every change.
Everyone's first thought is to handle the keys pressed, but you'd be suprised how many users paste into textbox's.
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++ VB Edition: VB to C++/CLI converter
Instant C++ C# Edition: C# to C++/CLI converter
|
|
|
|
|
|
Hii ,
Here i am creating all controls at runtime i.e, (Textbox,Chkbox,Rb,GridView,Picturebox,Label...... ,RectangleShape,OvalShape,LineShape).
How to implement Cut ,Copy ,Paste,Delete for all these types of controls ....
1) Here i am using ContextMenuStrip .--------------Using this how to delete , in that i am having Properties ,Cut,Copy,Paste,Delete,SendToBack,BringToFront
If i select, delete or copy or paste or cut it has to do the respective operations for the type of control listed above.How to identify the control.
i am getting the sender here as "ToolStripMenuItem" , How can i get the particular Control .
How can i identify the Control here ?????
2) if i press the delete button on keyboard , i am doing this
Ctr_KeyDown -- event handler <br />
<br />
If e.KeyCode = Keys.Delete Then<br />
<br />
If TypeOf sender Is TextBox Then<br />
<br />
Canvas.Controls.Remove(Sender) ........
But i am not able to delete the Picturebox ,& shape controls(due to it accepts only Control )
Thanks
For1206
|
|
|
|
|
I have this code for sending email but it gives me an error...plz help
my code:
Dim email As New System.Net.Mail.MailMessage
Dim credentials As New System.Net.NetworkCredential
Dim f As New MailAddress(from)
Dim t As New MailAddress(receipient)
Dim smtp As New SmtpClient
With credentials
.Domain = "www.gmail.com"
.UserName = "prubyholl"
.Password = "mypassword"
End With
With email
.From = f
.To.Add(t)
.Subject = subject
.Body = body
End With
With smtp
.Host = server 'contains the smtp server correctly
.Port = "587"
.EnableSsl = True
.Credentials = credentials
.Send(email)
End With
the error:
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required h19sm6066249wxd.28
Plz help
phatkin
|
|
|
|
|
Dim smtpClient As SmtpClient
Dim message As MailMessage
Dim fromAddress As MailAddress
smtpClient = New SmtpClient()
message = New MailMessage()
fromAddress = New MailAddress("From Address") ' Mention your from address
smtpClient.Host = "Your SMTP Host"
' Give your SMTP host address as mail.company.com, specify the host name or ipaddress of your server
'Default port will be 25
smtpClient.Port = 25
'From address will be given as a MailAddress Object
message.From = fromAddress
' To address collection of MailAddress
message.To.Add("To Address") ' Give your To Address
message.Subject = "Subject"
' Message body content
message.IsBodyHtml = True
message.Body = "Body Part"
' Send SMTP mail
smtpClient.Send(message)
Hi check this code, i used this long back. So if there are any small errors fix it. But it will work.
I think you have forgot to mention the SMTP Host, I mean Host IP address at the place of .Host = Server
Jats
|
|
|
|
|
i tried ur code but seems to have just a lil problem
anyway i was thinking about the using smtp server string address instead of the ip address? is that wrong?
also i learnt soemthing about credentials
so is my credentials also wrong?
Plz help?
Thanks
phatkin
|
|
|
|
|
You should always use a domain address ie smtp.myemailserver.com rather than the IP Address unless you are forced to you the IP Address.
There are several examples to how to send emails from VB.NET on CodeProject as this is a question asked an answered many time. You should search these out.
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 you have to use smtp.YourSmtpServer.com or .org or which ever is the type.
The address has to mail server address. IP is used very rarely, until unless it is asked for.
Its better to go with the above format i had mentioned (smtp.YourSmtpServer.com).
And even take a search in the forum you will find many examples. Try to analyze the code.
Jats
|
|
|
|
|
I tried using copyfile:
My.Computer.FileSystem.CopyFile(TempPath & filename, StartPath & "\Saved imgs")
but I dont think your allowed to copy from the Temporary Internet Files folder.
Is there any way to save an image from a web page?
Ive thought of three other options but havent been able to get any to work.
1. right click on the image from a WebBrowser to activate the menu? (but images are not htmlElements so you cant use htmlelement.InvokeMember("Click") )
2.Opening the image from a different container/application and saving it to a different directory. (pictureboxes arent allow to access the temporary internet files folder either)
3.Im able to get the URL to the image, can I use this to save the image?
Any ideas?
|
|
|
|
|
Hi all, i have a problem with job scheduling...
I have a ssis package (2 actually)... i need this package to loop over and over again. (this package monitors a folder on a server and waits for a specifiec file type before reading the values in that file into the database and formatting the data and ultimately creates a new file with the same name, replacing the old file). Currently i have 2 packages doing this one job... each package ends with a "Execute Package" task. So, Package A would execute Package B at the end and then Package B would execute Package A at the end. (this puts my Job in an infanite loop, which is what i wanted...) BUT now i noticed that each time the package executes the next package, the "Running Packages" (as seen when you log onto the "Integration Services" on the server in SQL Server 2005) gets one extra package... (i presume this takes up memory). So this can't be good in the long run.
So what i need help with is the following...
1. I need to put both packages into one package. (i know how to do this.)
2. I need to schedule the package in a job to execute every time the job ends successfully.
I need help with the number 2 please... i dont know how to schedule a job to execute as soon as it successfully ended???
Thank you in advance. (any suggestions will be greatly appreciated.)
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Is this a question about VB or SQL Server 2005?
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'
|
|
|
|
|
So sorry, i thought i clicked on the sql link...
my appologies...
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
HI
I AM IN POSITION TO FIND PRESENCE OF UNIQUE STRING(ALL ARE FILE NAMES) FOR THAT I AM PLANNING TO USE REGEX SEARCHING COULD. ANY SAY WHICH WILL BE BETTER ONE REGEX OR ARRAYLIST.BINARYSEARCH OTHERWISE ANY OTHER GOOD SERCHING TECHNIQUES .COUNT OF NAMES WILL BE MORE THAN 15K SO COULD ANY ONE SUGGEST WHICH ONE I SHOULD USE.
with regards
Balagurunathan.B
|
|
|
|