Answer Questions
trint Raising events from .NET UserControl inside a VB6 MDI form(Interop Forms Toolkit)
I have used the Interop Forms Toolkit example: http://blogs.msdn.com/vbteam/archive/2006/11/02/interop-roadmap-usercontrols-mdi-and-data.aspx , and am using the example InteropUserControl. I want to raise an event from my .NET UserControl which is hosted inside a VB6 VBControlExtender type: Private WithEvents moDynamic As VBControlExtender Set moDynamic = Controls.Add("InteropUserControl.InteropUserControl", "DynamicControl") The control loads fine. How do I raise an event from the .NET UserControl so it is trapped by the VBControlExtender I've had this working for quite some time in C#, however, recently one of my PV guys' machines started encoutering this exception every time ...Show All
ghost23 ClickOnce autoupdate question
I have an application that I published to a local network folder with ClickOnce. I set the autoupdate option to check once every 7 days. If I publish an update of the same apps and same network folder , do I need to keep the old version in that same path, or do I have to remove it first then publish, so that it will automatically pick up the new version Thanks Andrej. I'm going to assume it is safe to delete the old version and publish (don't want the old ones taking up space and create confusion) and autoupdate will still work. Yes, the publish version and assembly versions are two different things and are not(!) in sync with each other. You'll find the publish vers ...Show All
Microsoft_hates_me Mouse Move on the Panel Control
I want to catch the mouse move on a panel. I use the following Sub Private Sub Panel1_MouseMove( ByVal sender As Object , ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseMove End Sub But when the mouse is on another control of the panel ( lets say a label ) , the program doesn't trigger the sub. I have to write another mosemove sub for the child control or I have to add handles behind the other sub . But I don't want to do it for each control. Is there a way to solve this issue You want to capture the mouse so any mouse messages are directed to the panel control, not the control that the mouse cursor is currently hovering over. The code below demonstrates the techniqu ...Show All
Christie Myburgh Difference between WithEvents (Handles) vs Add Handler
I am learning VB 2005 and have a question. Events can be created either using With Events or using Add handler. So far VS IDE put all code related to with events and handles for me. Can any one explain add handler clause to me. What is the difference events created using with events and handles vs add handler Only thing I found on MSDN is that Add handler can be used during runtime instead of design time. Any one would be able to clarify You can't declare a local variable using "WithEvents". So if you want to progamatically add a TextBox, lets say, to your form you would have to declare the TextBox at the class level to use the WithEvents keyword. If however you want to declare the T ...Show All
Jan Byvaly Simple XML problem :)
If the following document is saved as "example.xml": </ xml> <nodeA> <nodeB> <nodeC> <nodeD> <value1>NO</value1> <value2>NO</value2> <value3>NO</value3> <value4>YES</value4> </nodeD> </nodeC> </nodeB> </nodeA> How can I then get value4 My code works along the following lines: Dim xml_doc As XmlDocument Dim xml_nodelist As XmlNodeList Dim xml_node As XmlNode xml_doc = New XmlDocument() Dim xml_reader As XmlTextReader = Nothing xml_reader = New xmlTextReader("example.xml") xml_doc.Load(xmlReader) xml_nodelist = xml_doc.SelectNodes("/nodeA/nodeB/nodeC/nodeD") ...Show All
djedziniak Program help please!!!
I'm working on a program that converts something in a metric unit of length (meters, centimeters, etc.) to something in another metric unit of length (meters, centimeters, etc.) Whenever I type in a number, check something in the first checkedlistbox, then check something in the second checked list box, and hit a button, all i get is zero in both boxes. Can someone help me with my code It's just a multiplication error, but I need some help on determining what it is. Thanks. Public Class Form1 Dim dblMultiplier As Double Dim newdblMultiplier As Double Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load CheckedListBox1.Items.Add("Yottameter(Ym)") CheckedListBox1.Items.Add("Zettameter( ...Show All
coachdunlop ListViewItems / ContainsKey Question
I have been looping thru my listviewitems to see if a particular one already exists. I guess it works well, but I'm concerned what it will be like when I have many items I stumbled onto the ContainsKey method of the items, but I don't seem to be able to get it to do anything useful. If I create a new project and drop a listview and a button on the form, I put this code in: Bam. That was it. Thanks! You bet! :) James www.jamesfoxall.com Hi there, You're 90% there! You need to use an overloaded method of Items.Add() and specify a key. Right now, you're specifying the display text but no key. Change your statement like this and your code will work: ...Show All
8- VB.net 2003 debugging problem
Hi all, I have a strange issue within vb.net 2003. I'm trying to step through some code within a project for example: if txtpassword.text = "" then msgbox "You must enter a password" exit sub end if If I put a breakpoint on the first line, when I run the app the breakpoint moves to the third line. What's stranger is when I step through code within this project it even steps onto empty lines. This is only happening within this one project. All of my other projects are working correctly. Does anyone know how to rectify this Thanks Paul I had that problem once. I resolved it by highlighting all the code and collapsing all the code. After that i turned of ...Show All
King Nerd How to let users choose their own installation path?
How can I let users choose their own installation path when I publish a program Thanks. Thanks, spotty! Not possible with Click Once as is basically sandboxes the deployment. If you want to allow users to install there applications into user defined folders you need to create a specific setup project. This project template is supplied for some versions of VB / VS but definately NOT for the express versions. ...Show All
DallasSteve String * 255 to VB6.FixedLengthString(255) conversion issue
what should I convert this to in .NET The upgrade wizard changed Dim s_ReturnValue As String * 255 to Dim s_ReturnValue As New VB6.FixedLengthString(255) When I get to System_SetItems which expects an integer value; Call GetPrivateProfileString( "App" , "Items" , "192" , s_ReturnValue.Value , 255, INI_Filename) Call System_SetItems( CInt (s_ReturnValue.Value )) <<<-------------- If I look at s_ReturnValue in the previous line, it shows "192 with no trailing double quote, which I imaging would be 250 or so places to the right I get system exception "input string was not in a correct format" Anyone been here Thank yo ...Show All
etcheverrjc How to Use MailMessage to Send MHTML?
I'm attempting to send an MHMTL document out as an email and am having issues getting it to do so. What I've done is created a windows service to poll reporting services for a "Web Archive" report (read in as a string or byte array via System.Net.WebClient) that I then want to send out to a set of people via System.Net.Mail.MailMessage. I'm aware that reporting services has subscriptions built in, but the situation is a little more complex than that and requires a seperate program to poll the report. What I'm looking for is some sort of code sample or something that demonstrates sending MHTML as part of the body of an email using VB.NET (Or C#) ASP.NET 2.0 standard objects. If anyone could point me in the right direction or ...Show All
Laurent87471 Leave Event
i cant seem to work out how to do this I am in textbox5 and on the leave event i want to have textbox1 to 4 leave events to be proformed and still be able to click into one of those textboxs in textbox5 click on textbox1 TextBox5_leaves(-------)handles textbox5.leave code leave textbox 1-4 end sub Textbox1_leaves(------) handles textbox1.leave, textbox2.leave, textbox3.leave, textbox4.leave code to preformed on the textbox five leave for each textbox end sub textbox1 has focus this works but i am getting this error the sender is set to nothing in the texbox1_leave any troughts System.NullReferenceException was unhandled Message="Object reference not set to an instan ...Show All
Rani09 DateTimePicker
I want to add a date time picker to a toolbar. What is the best way. I know I can just drop it on there, but it would cover up everything else I add to the toolbar Thanks Brian Just to clairify - VS2005 or 2003 VS2005 Hi, I think you may try to put a Button in the Toolbar, and put a Calendar control invisible. After the user click the button, you can show the calendar control. If you still have any concern, please feel free to post here. Best regards, Peter Huang ...Show All
Dave Houlbrooke make secure database configuration file
I want to make secure database configuration xml file and make it password protected. so guide me how would be achieved in visual basic 2005 or c#. Thanks It depends upon the level of security that you want...for simple file encryption: Public Shared Sub Encrypt (ByVal path As String ) Member of: System . IO . File Summary: Encrypts a file so that only the account used to encrypt the file can decrypt it. Parameters: path : A path that describes a file to encrypt. otherwise see: Namespace System.Security.Cryptography Member of: mscorlib Namespace System.Security.Cryptography Member of: System Summary: The System.Security.Cryptography namespace provides cryptograp ...Show All
Richard3D Print graphics that are on the form into PDF
I have placed many objects into the form ,like circle, square, images, etc etc directly on the forms background. Now i want to know how to take printout of them directly into printer or PDF in particular When I say, 'how', I mean how are you coding it Specifically, you are doing all your drawing in the paint event, aren't you I am a new learner to these things, so what i have figured out is due to the missing autoredraw property in .net, i am drawing the things to the bitmap, and in paint event, putting that bitmap onto the form. I cant put the drawing code in the paint event, cause i will be drawing the graphics items on the form dynamically in runtime. when i draw on the form, it will getinto the bitmap, which will be rep ...Show All
