|
Here is a sample from my connect.vb file. It shows a testing (dev) version of a button and the real version of the button. (These are command buttons in my Excel addin) I want them both to bring up the same form with a different db connection. Is there a way to pass a variable that gets set in these subs to the form?
Private Sub MyUpload_dev_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault As Boolean) Handles MyUpload_dev.Click
Dim frm As New frmGOUpload
frm.XLA = excelApp
frm.WS = excelApp.Workbooks(1).ActiveSheet
frm.Show()
End Sub
Private Sub MyUpload_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault As Boolean) Handles MyUpload.Click
Dim frm As New frmGOUpload
frm.XLA = excelApp
frm.WS = excelApp.Workbooks(1).ActiveSheet
frm.Show()
End Sub
This is kind of what I am thinking of trying to do in the form:
If <variable> = 'dev' then
Dim wsrv As New SEOWS_dev.Service1
else
Dim wsrv As New SEOWS.Service1
end if
|
|
|
|
|
Make a public Property on your saecond form. Set the property to whatever value you need to pass before the form is shown.
Dim frm As New frmGOUpload
frm.connString = "Whatever..."
frm.XLA = excelApp
frm.WS = excelApp.Workbooks(1).ActiveSheet
frm.Show()
Public Class frmGOUpload
...
Private m_ConnectionString As String
...
Public Property connString() As String
Get
Return m_ConnectionString
End Get
Public Set(ByVal Value As String)
m_ConnectionString = Value
End Set
End Property
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
"Normal" Concatenation of many small strings seems to be very slow in VB6.
Is there a something like a "string builder" or "preallocation"?
Pandoras Gift #44: Hope. The one that keeps you on suffering. aber.. "Wie gesagt, der Scheiss is' Therapie" boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
In VB6? I seem to remember that there was a Join function somewhere. ... searching... Ah! Here we go, Join function[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
True, but that only joins an array...
Dim strReturn as String
Dim arrString(3) as String
arrString(0) = "This "
arrString(1) = "is "
arrString(2) = "an "
arrString(3) = "example."
strReturn = Join(arrString)
strReturn now equals "This is an example."
|
|
|
|
|
Your point being?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Simply stating that though you are correct, the method is clumsy due to VB6 in itself being very limiting in its string concat abilities.
(ie. Not as simple as the StringBuilder class that was mentioned)
|
|
|
|
|
Considering this is the only function VB6 has to combine a bunch of smaller strings together into a single string, without using string concatentation, I think your point is moot. The goal of the OP was to get quicker performance out of putting the strings together, which Join will do, not to make it look pretty in code.
In VB6, you have two ways to do this. Either use string concatenation or use Join.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
In VB6, you have two ways to do this. Either use string concatenation or use Join.
Strictly, this is 100% true... but you can wrap the JOIN call into something easier (and more familiar to use)
Here's a good article:
VBScript StringBuilder[^]
|
|
|
|
|
I would like to be able to access one appdomain from another on the same machine. This used to be easy in vb6 to access COM objects as the GetObject() method could be used.
I know it is possible to do this using remoting, however this seems a bit of an overkill as both programs are running on the same machine. More importantly when I use remoting it triggers off alerts from my firewall. As I want my application to be easy to use I feel this will confuse some users and does not appear very professional.
Anyone got any suggestions?
Many Thanks
~ Tom ~
|
|
|
|
|
Hi All,
Could you please help me in the below problem?
I am getting the exception 'StackOverFlow' while executing the below code.
Dim nodeIter As XPathNodeIterator<br />
nodeIter = thisXMLNav.Select(thisXPQuery)
I am using .net framework 1.0. But in some other machines I am not finding this exception.
Thanks in Advance.
Madhu
|
|
|
|
|
i don't know what thisXMLNav.Select() is doing, but in general, stack overflow exceptions are thrown when a function calls itself, in an "infinite loop", until the stack have not enough memory to perform another function call...
is it a function of your own, or does it com from a library ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Although I have studied a lot about user interfaces but i havent got a clue what r they saying. i mean i m a beginner so any.. ..kind suggestions.
thanks.
Mian Rashed Inam Khattak
|
|
|
|
|
what do you want to know about interfaces ?
hum, let be accorded together, you talk about "user interfaces", or "VB interfaces" (in reference to the language keyword) ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
i think it should be like the gui interfaces in vb.
i think it is good enough now.
thanks
Mian Rashed Inam Khattak
|
|
|
|
|
Hello, I have a doubt:
I have a vb.net treeview, and I want that when I select one node, if I press the child of this node, then show a msgbox.
How I can capture the click event for the child of the node.
Thanks
|
|
|
|
|
Surely you can just get the click event of the treeview, record the id of the node clicked. Then when they click the next node check if the parent is the same as the one you recorded before then hey presto it's the child and then you can msgbox gallore
Hope that makes sense and fits the problem.
"If i was king cigarettes would be free."
|
|
|
|
|
Hi
Iam new to .NET i want to develop a component to
retrieve first 10 records from a oracle table pls just dont mail sql query
Thanks in advance
Regards
Lion Heart
Software Engineer
Bangalore
|
|
|
|
|
Dropping the same question in multiple forums is considered very rude...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I wanted to know how to drag an image from the word and drop it in RichTextBox or in Picture Box ? It's an windows application.
Thanks in advance.
Regards,
Shri
|
|
|
|
|
vb6 or vb.net?
"If i was king cigarettes would be free."
|
|
|
|
|
Hi all professional friends, anybody know how to code a "Combobox" in the some column of listview? I don't want to use with dataset. Because I need to add some item into combobox myself and let customer select the combobox item in the listview.
|
|
|
|
|
Dim oCom As New ComboBox
oCom.Visible = True
With ListView1
.Controls.Add(oCom)
End With
Worked for me!
"If i was king cigarettes would be free."
|
|
|
|
|
Thank you. But this not I want.
Is like this....
If I have three columns, and each column item I need to have a combobox.
|
|
|
|
|
I remember that in vb6 there was a way to get where a form close was called from (ie. clicked x, computer shut down etc.) Is there a way to get this in .net.
|
|
|
|