|
Hi Shinay,
This way is worked, except that I have to do two steps.
Thanks
|
|
|
|
|
I am receiving this error when trying to open an oledb connection on an Excel file from within VB.NET. All samples I have seen seem straight forward but for some reason I cannot connect to the file. My Connection string is "Provider=Microsoft.Jet.Oledb.4.0;Datasource=c:\file.xls;Extended Properties=Excel 8.0;HDR=Yes".
I have attempted to manipulate my connection string with different properties with no luck. If anyone has any suggestions as to what is wrong please let me know.
|
|
|
|
|
I have a dialog with a treeview and a listview. I want the listview to change when i select a different node on the treeview (I use the AfterSelect event of the treeview) - before I show the dialog using dlg.ShowDialog() I want to populate the treeview and then in the code select the a treeview node to fire the AfterSelect event which will populate the listview then I want to programatically select some items in the listview.
The problem is that the AfterSelect event doesn't seem to get fired until the dlg is shown so if I do
<br />
call dlg.PopulateTreeView()<br />
call dlg.SelectListViewItems()<br />
dlg.ShowDialog()<br />
the listview isn't populated when I call dlg.SelectListViewItems
Is there a well known way of doing this?
Rugby League: The Greatest Game Of All.
|
|
|
|
|
You might want to try calling Application.DoEvents() before you call the dlg.ShowDialog(). It's no so much of a problem of when the event gets fired, but when it can get processed.
RageInTheMachine9532
|
|
|
|
|
I already tried that, it didn't make a difference.
Rugby League: The Greatest Game Of All.
|
|
|
|
|
OK. After going back and re-reading the original post, I misunderstood you.
Calling the Select methods in the ListView and TreeViews will NOT fire the AfterSelect events). They will only fire on mouse clicks. But, you can call those functions from another form's code if those functions are marked public. A better method would be to have your event handlers call these functions seperatly so you can make the functions public and not the eventhandlers:
The following is not useable code. It is a pseudo-code example for illustration purposes only!
Form1:
Dim dlg As New Dialog1
dlg.PopulateTreeView()
dlg.AfterSelectHandlerFunction()
dlg.ShowDialog()
Dialog1:
Private Sub TreeView_AfterSelect([eventargs stuff]) Handles TreeView.AfterSelect
AfterSelectHandlerFunction()
End Sub
Public Sub AfterSelectHandlerFunction()
[code to do whatever here]
End Sub
RageInTheMachine9532
"...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
When you create a toolbar in any .NET application, (I'm working in VB.net but I had the same problem in C#.net) and set the background image to whatever image you want, if the toolbar appearance is "flat" the background image takes over the toolbar and instead of the toolbar being gray, it's like the background image was also tiled on the toolbar
anyone ever seen this? There's no code involved to reproduce this problem, all you need is a toolbar with the appearance set to flat, and a background image
|
|
|
|
|
I have a question. How do I programmaticly open the System Properties dialog just like the user right clicked My Computer and selected Properties. I am using VB6. Any help would be GREATLY appreciated!
The Dragon
|
|
|
|
|
Ooops....found it. Here it is if anyone else is looking for it: link
The Dragon
|
|
|
|
|
Dear Expert,
I'm a mschart control newbie. Here are 3 Questions needed your help.
(below is supposing to use this contorl in VB , you can also use it in VC, or other windows program tools capable of using this ActiveX controls, the encountered problem is same)
Q1: When I set *.ChartType=VtChChartType2dXY, How can I set X-asis Label to
my own expected string instead of Xas automatic generated by
itself.(Such as datetime instead of "0 1 2 3 ...")
Q2: Both when *.ChartType=VtChChartType2dXY or VtChChartType2dLine,
and when Xas Lable string is too long , How can I display it in Multi-line
Q3: When *.ChartType=VtChChartType2dLine , and after I set xasis.tick.style=...Inside,
& xasis.tick.length=200, it does not take effect, nothing changes , and what I expected to occur does not occur
In sum, What I want to do is by using mschart (must , cant use any other 3rd party controls),
set xasis infos(such as label , tick style, length) customarily by my expected format
Thanks in advance , Expecting your answer!
Allen, Homer
|
|
|
|
|
Hi everybody,
i'm making a addin for outlook 2k3, it works fine but i can't add commandbarbutton in Standard commandbar.
Can you help me ?
this is my code source :
Public Sub OnStartupComplete(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnStartupComplete
Dim oType As Type
Dim oArgs As Object()
Dim objMissing As Object = Missing.Value
'TODO: Connecter une nouvelle barre d'outils
' Ajout du bouton dans la barre standard
Try
oType = applicationObject.GetType
objCommandBars = oType.InvokeMember("CommandBars", BindingFlags.GetProperty, Nothing, applicationObject, Nothing)
stdCommandBar = objCommandBars.Item("Standard")
btnFortune = stdCommandBar.FindControl(MsoControlType.msoControlButton, objMissing, , "Fortune", True)
If (btnFortune Is Nothing) Then
btnFortune = stdCommandBar.Controls.Add(MsoControlType.msoControlButton, objMissing, objMissing, objMissing, objMissing)
btnFortune.Caption = "Fortune"
btnFortune.Style = MsoButtonStyle.msoButtonCaption
btnFortune.Tag = "Fortune"
btnFortune.Visible = True
End If
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.Message, ex.Source)
End Try
End Sub
At run, I take a "Unknown name" error (french message : "Nom Inconnu") on line "objCommandBars = oType.InvokeMember("CommandBars", BindingFlags.GetProperty, Nothing, applicationObject, Nothing)"
Thanks for your help.
Seb.
Sébastien FERRAND
|
|
|
|
|
If I have a DB on one machine in a network and I connect to it from an app on another machine, how do I supply the username and password for the PC with the DB on it. Is it done through the connection string or is there another way to get the client to pre-log on before attempting to make a connection to the DB.
Greg
|
|
|
|
|
Normally, you'd supply that information in the connection string. Is this an SQL Server? If so, then all you need is the SQL username and password in the connection string. I would avoid using Windows authentication or trusted connections if at all possible. Using an SQL login is more secure because this ID won't have access to the underlying server.
But if it's an Access database, then you'll have to authenticate to the machine before you can even attempt to get to the Access database. On the side, Access databases we're not designed for connections from other machines. It will work, but performance stinks and the number of connections you can get is, normally, very limited.
RageInTheMachine9532
|
|
|
|
|
Trust me I would love to be able to implement in SQL Server, But unfortunately I am pretty tied into Access, although admitidly performance is not really an issue. Which leaves the authentication problem. How can you, in VB .Net Authenticate a client logging onto another machine?
Greg
|
|
|
|
|
You can't do it entirely in managed code yet. You'd have to map a drive using the WNetUseConnection API. See this MSDN Article[^] for VB6 code on how to do this (translates pretty good to VB.NET)
You might also want to look into using the Windows Scripting Host Network object to do it too.
RageInTheMachine9532
|
|
|
|
|
Hi,
Could someone help developing an application to monitor the web activity. I want to develop something like an internet spy software which monitors the web sites opened by my internet explorer.
Till now i have just been able to create a new instance of the internet explorer object and monitor the activity of the instance.
But any other instances creates other than that by the application are not monitored.
|
|
|
|
|
IE already has this built in, called History.
RageInTheMachine9532
|
|
|
|
|
|
HI!
Now what?
RageInTheMachine9532
|
|
|
|
|
The system.web.mail namespace allows for sending mail via SMTP right. But one thing I cant figure out. What if the SMTP server requires authentication? Can the SMTPMail class log you into the server and if so, how? or is there another way?
Greg
|
|
|
|
|
The System.Web.Mail class doesn't yet support logging into an SMTP server. You'd have to either search the web for a 3rd party variant or write a better SMTP class yourself.
RageInTheMachine9532
|
|
|
|
|
Hi all,
I'm attempting to make a custom Textbox that is not derrived from the WinForms Textbox, Richtextbox, or Textboxbase with VB.Net or C#.
I am at a loss of how to procede. Does anyone have any suggestions? Chris Losinger posted an article[^] explaining it in C++ (but I can't use the code), and the SharpDevelop editor is too complex for my needs.
Thanks,
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
You would either start a Windows Control Library or Windows Application project to start. This will give you the basic functionality of your control, like handling input, controlling the controls bounds, supplying your window handle, ..., but no painting code at all. See this[^] for a documentation start on MSDN.
RageInTheMachine9532
|
|
|
|
|
Thanks. It's not much, but it is a start.
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
Is there a way to add images into the listview columns kinda like how outlook can display a paperclip instead of text? I have seen that people say that you must tie into the API to do it, but no one provides examples. Does any one know how to do it and is willing to share how they did it?
Thanks,
- Nick
The network is down...let's go get bagels.
|
|
|
|