473,396 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Form1 can't getfocus again...

Hi All,

After enter the textbox1 ( whatever type text in or not ), I can't make
the Form1_GotFocus event again....
I use that event to change form apparel.....

Best regards,
Boki.

-----------------------------

Public Class Form1
Private mouseOffset As Point
Private isMouseDown As Boolean = False

Private Sub Form1_GotFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.GotFocus
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.Fixed3D
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
UpdateInfo()

End Sub

Private Sub WebBrowser1_DocumentCompleted(ByVal sender As Object,
ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEv entArgs)
Handles WebBrowser1.DocumentCompleted

WebBrowser2.Navigate("http://mis.tse.com.tw/Quotes/Best5?Refresh=0&StkNo=2392")

Dim pos As Integer
pos = InStr(WebBrowser1.DocumentText, "C)", CompareMethod.Text)
Label1.Text = "T:" & Mid(WebBrowser1.DocumentText, pos + 65, 4)

pos = InStr(WebBrowser1.DocumentText, "(%)",
CompareMethod.Text)
Label2.Text = "H:" & Mid(WebBrowser1.DocumentText, pos + 66, 3)

Label4.Text = Mid$(TimeOfDay(), 4, 9)

End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs)
'UpdateInfo()

' Label1.Text = "Auto updating..."
End Sub
Private Sub WebBrowser2_DocumentCompleted(ByVal sender As Object,
ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEv entArgs)
Handles WebBrowser2.DocumentCompleted
'-----stock information
Dim pos As Integer
pos = InStr(WebBrowser2.DocumentText, "MatchPrice",
CompareMethod.Text)
Label5.Text = "S: " & Mid(WebBrowser2.DocumentText, pos + 12,
5)

End Sub

Private Sub UpdateInfo()
WebBrowser1.Navigate("http://www.cwb.gov.tw/V5/observe/real/real_data_46692.htm")
End Sub

Private Sub Form1_LostFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.LostFocus
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
End Sub
Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As
MouseEventArgs) Handles MyBase.MouseUp
If e.Button = Windows.Forms.MouseButtons.Right Then
UpdateInfo()
End If
End Sub

Private Sub TextBox1_DoubleClick(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TextBox1.DoubleClick
Shell("D:\Program Files\Mozilla Firefox\firefox.exe
http://tw.dictionary.yahoo.com/search?ei=UTF-8&p=" & TextBox1.Text)

End Sub
End Class

Apr 20 '06 #1
3 2014
Try using the Form's Activate and Deactivate events, instead. See my
reply to your prev. post.

Regards,

Cerebrus.

Apr 20 '06 #2
I mean "Activated" event ! ;-)

Regards,

Cerebrus.

Apr 20 '06 #3

Cerebrus 寫道:
Try using the Form's Activate and Deactivate events, instead. See my
reply to your prev. post.

Regards,

Cerebrus.

much better..

Best regards,
Boki.

Apr 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: polarz | last post by:
I'm having trouble getting items from different classes to display in my textBox. e.g. private void button2_Click(object sender, System.EventArgs e) { someData sd = new someData();...
0
by: Kitchen Bin | last post by:
HELP PLEASE!! The C# Visual Studio IDE is failing to load an inherited form into the IDE from a base form when I add items to an array property of a user control on the base form. That sounds...
5
by: nadir b | last post by:
hi I don't know how to change for exemple a form1 caption text from form2 don't forget that form2 has created from form1 I want sample code with c# *** Sent via Developersdex...
3
by: Jon Natwick | last post by:
This "Countdown Timer" code works fine with Ie, but I receive an "Error: Form1 is not defined" error with Firefox 1.0.0 and 1.0.1. <body MS_POSITIONING="FlowLayout" onload="InitializeTimer()">...
2
by: Mr Newbie | last post by:
Hi , The following code in the Page_Load event will add a textbox to the webform. The question is regarding the name of the form "Form1". Q1.) Is this something which ASP.NET names arbitarily...
3
by: Colin McGuire | last post by:
Hi again NG, this question follows from a similar question that I have thought through a bit more, and the next problem I encountered :( Here is the issue clearly: if I have form1 with a button...
2
by: Hareth | last post by:
VS2003 if i say dim form1 as new form1 form1.show() It opens a new form everytime... But....what if....
7
by: Boki | last post by:
Hi All, I want to change WindowState of form1 from form2. I tried these two methods, but no luck on both. (1) Declare a public method: /* function of form1 */ public void...
2
by: lewisms | last post by:
Hello all, I am quite new to c++/. Net so please don't shoot me down for being a newbie. Any way I am trying to make a simple multithreading program that is just to learn the ideas behind it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.