|
Hello To all
I have a text box that displays the date and it work my problem is it dont change when the date changes to the next day ??
here is my code Textbox1.text is the text box with the date in it
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = True
TextBox1.Text = Format(Now, "M")
Timer1.Interval = 60000
Timer1.Start()
Thanks everyone for your help
everyone has been grate here
Bob
|
|
|
|
|
Ask yourself when and how often does Form1_Load execute.
|
|
|
|
|
Thanks Luc i shold have no that hehe
Thanks to good pepole like your self
pepole like me can lern vb
This is what i did to fix it and it seems to work
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
TextBox1.Text = Format(Now, "M")
End Sub
Thanks agine for every one help
|
|
|
|
|
I want to create "views" of a web page, to do that I´m retrieving and editing the html code to show what I want in a new small webbrowser:
Dim PageHTMLBytes() As Byte
Dim htmlText as string = ""
PageHTMLBytes = webClient.DownloadData(url)
' Convert result from byte array to string
Dim utf8 As New UTF8Encoding()
htmlText = utf8.GetString(PageHTMLBytes)
...
-Edit of the html code-
...
miniWebBrowser.DocumentText = editedhtmlText
The problem is that one part of the editedhtmlText I´m showing, is a flash object which checks if you are logged in, but it doesn´t matter if I logged before, as soon as I set my own, edited code, the session is lost. I tried setting cookies like this:
Dim request As HttpWebRequest = WebRequest.Create("http://www.cam4.com")
'Set cookies.
request.CookieContainer = New CookieContainer()
request.CookieContainer.Add(New Cookie("user", "usuario1", "/", url))
request.CookieContainer.Add(New Cookie("password", "password1", "/", url))
Dim response As HttpWebResponse = request.GetResponse()
Dim reader As IO.StreamReader = New IO.StreamReader(response.GetResponseStream(), True)
Dim html As String = reader.ReadToEnd()
web.DocumentText = html
..which throws no errors but no luck at all in keeping my session. I started to fiddle about with webrequest and responses instead of downloading the html code, but I couldn´t go much further.
I´m on Windows XP 32 bits, VB 2008 Express, Net. Framework 2.0 SP1 (for legacy support). Some assistance on how can I aboard this problem will be appreciated.
|
|
|
|
|
|
Hi all
I am creating a program in which I am executing a bach file, which requires a "Enter key" hit to execute, as below :
Dim prc As New Process
With prc.StartInfo
.FileName = "e:\abc.bat" 'batchfile to execute
.UseShellExecute = False
.RedirectStandardInput = True
End With
prc.Start()
prc.StandardInput.WriteLine("{enter}")
prc.Close()
Now the above code run successfully and it appears a command prompt window showing "e:\abc.bat" file is executing but the code
prc.StandardInput.WriteLine("{enter}") is not redirecting enter key to completely execute the batch file.
How can I use "Enter key" hit on that command prompt window in vb.net.
Thanks.
Gagan
|
|
|
|
|
Lookup Console/StandardInput.ReadLine() or .ReadKey() and test for enter.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks Henry for your suggestion but I have already tried these methods and there is no effect when a command window appears showing "abc.bat" is running.
I only want to do that when my batch file start executing, it takes a "Enter key hit" from program to completely execute my batch file(because it requires a Enter key hit for further execution)and not wait for hitting Enter mannually from user.
Suggest me how can I do that.
Thanks.
Gagan
|
|
|
|
|
Hi,
I hava piece of code which creates a networl drive on the user's system. I need to hide the network.
The purpose of doing this is that the user while using an application need to connect to the Access db on a file server. But shouldn't know that the drive is mapped onhis computer.
Thanks
Sanjeev
Sanjeev
|
|
|
|
|
I may be misunderstanding your problem but doesn't the standard Data Source parameter accept a URI - ServerMachineName\PathOnServer.mdb?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Then don't map the drive. Use the UNC path that the map points to instead.
|
|
|
|
|
I have one form in which I am searching the database table as :
cmd = New SqlCommand(" SELECT * FROM client_details WHERE DateofJoining BETWEEN #" + ddfrm + "# AND #" + ddto + "# ")
con.Open()
where, "client_details" is my database table name. And "DateofJoining" is a column.
In 2nd form, I have a datagridview, in which I have stored the data with several columns.
I want to get the number of rows from the updated datagridview in 2nd form using the filtered criteria which I did in my 1st form above.
I am trying but not able to update the datagridview using the filter.
Do i need to call any public function in 2nd form from the 1st form?
|
|
|
|
|
Yes.Make it as a Public Function in form1 and then call it from form2.
|
|
|
|
|
hi,
was wondering if it is possible to code a program to "right click" / bring up context menu for a file.
so to be a little less vague;
i have heaps of templates (win word, excel...), you right click and select "New"
which opens the respective office app with the template loaded into a fresh doc.
how could i do this programatically, rather that simply opening the file through vb or doing it manually?
apologies if this has already been answered, i have searched for it
-N
|
|
|
|
|
Right click on what?
There is an article around with global keyboard and mouse hooks I saw recently.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Yeah but you must be viewing the list of templates in something, explorer presumably!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi, Friends
How I can Edit My Image In Databsae?
With Command Sql("Update Tabal Set ... ")
Thank You.
modified 3-Aug-12 18:22pm.
|
|
|
|
|
There are a number of good articles [^]in this lot.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
write a windows application that allows the user to enter a seven-digit number in a multiple line textbox when the user clicks the generate words button.
<br />
<br />
Public Class Form1<br />
Dim digits As Integer() = New Integer(6) {}<br />
Dim letters As String(,) = New String(,) {{" ", " ", " "}, _<br />
{" ", " ", " "}, {"A", "B", "C"}, {"D", "E", "F"}, _<br />
{"G", "H", "I"}, {"J", "K", "L"}, {"M", "N", "O"}, _<br />
{"P", "R", "S"}, {"T", "U", "V"}, {"W", "X", "Y"}}<br />
<br />
Dim phoneNumber As Integer<br />
Dim Number As String<br />
Dim OutPut As String<br />
<br />
<br />
Private Sub GenerateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GenerateButton.Click<br />
<br />
phoneNumber = Convert.ToInt32(Number)<br />
<br />
For i As Integer = 6 To 0 Step -1<br />
digits(i) = phoneNumber Mod 10<br />
phoneNumber \= 10<br />
' MessageBox.Show("Number = " & Str(phoneNumber))<br />
<br />
For loop1 As Integer = 0 To 2<br />
For loop2 As Integer = 0 To 2<br />
For loop3 As Integer = 0 To 2<br />
For loop4 As Integer = 0 To 2<br />
For loop5 As Integer = 0 To 2<br />
For loop6 As Integer = 0 To 2<br />
For loop7 As Integer = 0 To 2<br />
OutPut &= String.Format("{0, -10}", _<br />
letters(digits(0), loop1) & _<br />
letters(digits(1), loop2) & _<br />
letters(digits(2), loop3) & _<br />
letters(digits(3), loop4) & _<br />
letters(digits(4), loop5) & _<br />
letters(digits(5), loop6) & _<br />
letters(digits(6), loop7))<br />
Next<br />
Next<br />
Next<br />
Next<br />
Next<br />
Next<br />
Next<br />
Next<br />
<br />
End Sub<br />
<br />
<br />
Private Sub PhoneNumberTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PhoneNumberTextBox.TextChanged<br />
Number = PhoneNumberTextBox.Text<br />
End Sub<br />
<br />
Private Sub PhoneNumberWordsListBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PhoneNumberWordsListBox.SelectedIndexChanged<br />
OutPut = PhoneNumberWordsListBox.Text<br />
End Sub<br />
End Class<br />
but I couldn't output the words can some one help me please.
thanks
|
|
|
|
|
This looks like a mess, I don't see how you expect it to work. You have nested loops, which means each inner loop will run completely for each iteration of an outer loop. That makes sense only if you're building a list of strings that way, not outputting as you go.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I'll give you a clue, to get you started.
Dim numberToWord As New Dictionary(Of Integer, string)
numberToWord.Add(0, "Zero")
numberToWord.Add(1, "One")
numberToWord.Add(2, "Two")
numberToWord.Add(3, "Three")
numberToWord.Add(4, "Four")
........
........
or since the user enters the number as text you could do it as:
Dim numberToWord As New Dictionary(Of Char, string)
numberToWord.Add("0"C, "Zero")
numberToWord.Add("1"C, "One")
numberToWord.Add("2"C, "Two")
numberToWord.Add("3"C, "Three")
numberToWord.Add("4"C, "Four")
........
........
Look up anything you don't understand on MSDN or Google it.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
<br />
Partial Class Form1<br />
Inherits System.Windows.Forms.Form<br />
<br />
Public Numbers(7, 3) As String<br />
Public Phonenumber As Integer<br />
Public output As String<br />
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
<br />
Numbers(0, 0) = "A" <br />
Numbers(0, 1) = "B" '2 <br />
Numbers(0, 2) = "C" '2 <br />
Numbers(1, 0) = "D" '3 <br />
Numbers(1, 1) = "E" '3 <br />
Numbers(1, 2) = "F" '3 <br />
Numbers(2, 0) = "G" '4 <br />
Numbers(2, 1) = "H" '4 <br />
Numbers(2, 2) = "I" '4 <br />
Numbers(3, 0) = "J" '5 <br />
Numbers(3, 1) = "K" '5 <br />
Numbers(3, 2) = "L" '5 <br />
Numbers(4, 0) = "M" '6 <br />
Numbers(4, 1) = "N" '6 <br />
Numbers(4, 2) = "O" '6 <br />
Numbers(5, 0) = "P" '7 <br />
Numbers(5, 1) = "R" '7 <br />
Numbers(5, 2) = "S" '7 <br />
Numbers(6, 0) = "T" '8 <br />
Numbers(6, 1) = "U" '8 <br />
Numbers(6, 2) = "V" '8 <br />
Numbers(7, 0) = "W" '9 <br />
Numbers(7, 1) = "X" '9 <br />
Numbers(7, 2) = "Y" '9<br />
<br />
<br />
End Sub<br />
Private Sub GenerateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GenerateButton.Click<br />
<br />
<br />
Dim phoneNumber As String = GetNumber()<br />
<br />
'check if the number contains 0 or 1<br />
While phoneNumber.Contains("0") Or phoneNumber.Contains("1")<br />
phoneNumber = GetNumber()<br />
End While<br />
<br />
'create a hashtable to hold the digits<br />
Dim arrayL As New Hashtable<br />
Dim x As Integer = 1<br />
For i As Integer = 65 To 90 Step 3<br />
arrayL.Add(x, New Char() {Chr(i), Chr(i + 1), Chr(i + 2)})<br />
x += 1<br />
Next<br />
<br />
Dim word As String = ""<br />
<br />
'creates only 3 words out of the phonenumber<br />
For i As Integer = 0 To 2<br />
<br />
For Each s As String In phoneNumber<br />
word = word & DirectCast(arrayL.Item(CInt(s)), Char())(i).ToString<br />
Next<br />
Next<br />
<br />
output = PhoneNumberWordsListBox.Text<br />
<br />
<br />
End Sub<br />
<br />
<br />
<br />
Private Sub PhoneNumberTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PhoneNumberTextBox.TextChanged<br />
Phonenumber = PhoneNumberTextBox.Text<br />
<br />
End Sub<br />
Private Function GetNumber() As String<br />
<br />
Return PhoneNumberTextBox.Text()<br />
End Function<br />
End Class<br />
<br />
<br />
Please help me I can't print the words in listbox
|
|
|
|
|
how to print on second page in visual page 6.0
|
|
|
|
|
i have a designed usercontrol called "bar" and i have a menu strip called "add bar" and "add note"..
when user click add bar, it will create a new "bar".
when user click on add note, it will create a panel that is create at runtime. that panel is consist of labels. now assume, at runtime, i have click "add bar" twice so it will be two "bar" but at different place.
what i want is when user click either one of it, it will be the selected one, and when user click on "add note" it will create on the selected one "bar"
i have done that. but the problem is, when i click "add note", the panel will placed at x = 0 at the selected one, thats correct, but when i selected the other usercontrol, and click "add note" it will create panel at different place, not at x = 0. it should be at x = 0, because now the selected one is the other "bar",and there is no panel yet. some one please help me.
maybe how to detect control in a panel. if there is a control than, the x will not be 0. and if there is no control, x will be 0.
thanks.
|
|
|
|
|