|
I'm a little confused as all the parts are there.
If you are in main form, you open the browser (form1) if it is not already open and navigate to the url.
If you are in main form, and the browser is already open, send it the link via a public method, create the new tab and navigate to the url passed in via the message.
The article I linked to will show how to handle multiple tabs, and the rest is standard form interaction.
|
|
|
|
|
I'm not sure if you've understood my question correctly. I'll try explain it a bit more.
I have made a web browser that uses tabcontrol in "form1".
"mainform" is where I want to access the browser from, normally you would just use "form1.Show()" on the button, and it would open the browser form.
However I want it to open the browser "form1" and navigate to a specified url. The code I supplied only works with a browser made without using tabcontrol.
Hopefully I've explained it well enough now.
Thanks,
Brad
|
|
|
|
|
And my answer before this one, tells you what do to to achieve this.
See this article on how to pass values between forms if you are unsure of how to do this; Passing Values between Forms in .NET 1.x with C# and VB.NET examples[^]
On the browser form, read the url, create a new browser tab and then fire of the browser control navigate to the method (the same way as you would be doing at present).
|
|
|
|
|
I'm really hoping someone is able to give me the code. I looked at that link and I saw how I was able to get a url into the address bar, though not navigate to it.
|
|
|
|
|
|
It's a tab control browser. It doesn't use webbrowser1. And everytime I put tabcontrol1.navigate("url") it give me the error that navigate is not declared in form1.
|
|
|
|
|
But what is inside the tab control? it has to be a web browser control.
You need to be reading what we are telling you, and looking at the links we are giving you and start to digest the information and think about what you are doing, not just blindly copy and pasting what you are doing, you will get nowhere if you work like that.
|
|
|
|
|
I still am not able to get my head around this one =/
|
|
|
|
|
|
Sorted it out myself using
Form1.Show()
Form1.addresssearch.Text = "URL HERE"
Form1.gosearch.PerformClick()
|
|
|
|
|
How can i make movable buttons?
These buttons will represent the computers installed in a cybercafe.
These buttons will moove depending on administrators choice.
Thnx
|
|
|
|
|
Set their Left/Top properties via code. That's the basics of it, at least.
Anything specific you are stuck with?
|
|
|
|
|
I don't have any code.
can you help me please?
|
|
|
|
|
Hello everybody
This is the code for saving data in my acess database.
it works but the problem is that i can't save the flexgrid data.
Can anyone of you help me solving this????
Call DB
With ar
.Open "Select *From tblSupplies", strConek, adOpenStatic, adLockOptimistic
.AddNew
!Time = txtTime
!Date = txtDate
!User = txtUser
!VTotal = txtVTotal
!Qty = txtQTY
!Nr = txtNr
!ProdName = FG1.TextMatrix(FG1.Rows - 1, 2)
!Supplier = txtSupplier
.Update
MsgBox "Quanitities of product are being updated.", vbInformation, "POS"
End With
End Sub
|
|
|
|
|
What exception you are getting? As per your code you should have atleast 1 row and 2 columns in the flexgrid. The syntax for using TextMatrix property looks correct. I can help if you can provide more details about the rows and columns in it....
|
|
|
|
|
Form-Load i have insert this code :
With Me.FG1
.ColWidth(0) = 0
.ColWidth(1) = 1000
.ColWidth(2) = 4380
.ColWidth(3) = 1100
.ColWidth(4) = 1500
.ColWidth(5) = 1500
.Row = 0
.Col = 1
.Text = "Nr."
.Col = 2
.Text = "Product"
.Col = 3
.Text = "Quantity"
.Col = 4
.Text = "Price/Unit"
.Col = 5
.Text = "Price"
End With
txtTime.Text = Format(Now, "HH:mm")
txtDate.Text = Format(Now, "dd/mm/yyyy")
FG1.SelectionMode = flexSelectionByRow
End Sub
|
|
|
|
|
Hello everybody,
I want to extend the Trace method in order to write to different target files using the 'Trace.Writeline' command.
Imports System.Runtime.CompilerServices
Module mdlTraceListenerExtensions
<Extension()> _
Public Sub WriteLine(ByVal tr As Trace, ByVal LogType As Integer, ByVal message As String)
If Not tr Is Nothing Then (Do-what-has-to-be-done)
End Sub
End Module Everything compiles without errors, but the new overload doesn't show up in intellisense. Could someone pls. tell me where I'm going wrong?
Thanks,
Mick
|
|
|
|
|
Did you remember to import the module containing the extension method in the code where you're trying to call it?
Also, I'm not sure about VB, but I know that in C#, if you're trying to call an extension method on "this" (which in VB would be "Me"), you actually have to specify "this.MyExtensionMethod()" instead of just calling the method as if it were an instance method: "MyExtensionMethod()"
|
|
|
|
|
Thank you, ekolis - I didn't do that!
But obviously that was not all I had to do - my 'Trace.Writeline(...)' calls still only showed the 4 common overloads. Following the other hints, too, I instantiated the trace class and the instance was extended, so that I could see my extension in IntelliSense finally.
Unfortunately, one major reason why I chose the Trace class was, that it usually doesn't need an instance: After adding the listener to the TraceListeners collection, all the modules can simply call the 'Trace.Writeline(...)' method, which doesn't throw any errors once there were no listeners added. Creating an instance, on the other side, throws an error once the instance variable goes out of scope.
I solved the practical issue by creating different instances now, but still I'm curious if there's really no other way to extend the .NET Trace class. Any further hints appreciated!
|
|
|
|
|
I tried it and it seems to be working. Did you Import the correct Namespace into your code file. Here is what I did:-
The Extension
Imports System.Runtime.CompilerServices
Namespace MyExtensions
Module mdlTraceListenerExtensions
<Extension()> _
Public Sub MyWriteLine(ByVal tr As Trace, ByVal LogType As Integer, ByVal message As String)
If Not tr Is Nothing Then
End If
End Sub
End Module
End Namespace
And the usage:-
Imports System.Data.SqlClient
Imports System.Data.OleDb
Imports System.Text
Imports System.IO
Imports CodeProjectVBTest.MyExtensions
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim i As Integer = 19
Dim tr As Trace
tr.MyWriteLine(19, "Hello")
End Sub
End Class
I changed it to MyWriteLine just to ensure I had the correct one, but it works also using WriteLine. maybe you can see where you went wrong from this, otherwise, sorry, I cannot see where you went wrong.
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Thank you, Wayne - that was of great help, too! Pls. see my other remarks @ekolis above.
|
|
|
|
|
Have you tried calling the method by its fully qualified name and passing in the required arguments?
i.e
mdlTraceListenerExtensions.Writeline(tr,logtype,message)
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Thank you, Simon! Pls. see my remarks @ekolis above.
|
|
|
|
|
Extension methods are instance methods, they can't be static/shared. See MSDN[^].
|
|
|
|
|
Hello Everyone,
iam searching for a methode to get the calling number to a vb.net project.
i will get the number to search it on our erp/crm database that i can get the customerno from it.
May anyone have a idea?
|
|
|
|