Monday, December 29, 2008
There are actually a number of ways to do this. Below are three ways:
1. The easiest way to do this is to just raise an event in the Custom Control and handle that event in the Form.
Public Event LinkClicked(ByVal sender As Object, ByVal e As EventArgs)
Private Sub LinkLabel1_LinkClicked(ByVal sender As Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
RaiseEvent LinkClicked(sender, e)
2. Another way is to have a PictureBox value in the form point to the PictureBox that is on the control. And then address the Mouse events there. You'll need a way to return the Control to you via a FindControl routine in your Custom Control
Public Function FindControl(ByVal Name As String) As Control
For Each c As Control In Me.Controls
If c.Name.ToLower = Name.ToLower Then
Then in your Form you would do the following:
WithEvents MyFullImage As PictureBox
And in your Form_Load event:
MyFullImage = ImgEditor1.FindControl("FullImage") 'This is assuming the FullImage is the name of the Picturebox in your Control
And then you can do the following:
Private Sub MyFullImage_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyFullImage.MouseDown
3. Lastly you would still use the FindControl mentioned in method 2, but do the following
'Add this to form_load
Dim pctBox as PictureBox = MyUserControl1.FindControl("FullImage")
AddHandler pctBox.Click, AddressOf TestClick
Private Sub TestClick(ByVal sender As Object, ByVal e As System.EventArgs)
MsgBox("Testing AddHandler Method")
Wednesday, December 24, 2008
Tuesday, December 23, 2008
What ended up fixing my problem was that in my structure was a Boolean variable. When I changed that Boolean to Integer then all of a sudden everything worked.
I'll post code samples shortly.
Wednesday, December 10, 2008
Whenever I have to go to the know or to timecard or to a teamsite, I get this dialog box which prompts me to enter a username and password in firefox. I don't get this in IE. The fix in firefox is this:
1. Open Firefox
2. Navigate to the url about:config
3. Locate the following preference names and put as the value the comma separated values of the address roots.
Your value should look something like this: localhost,companyname.org