Answer Questions
KevinBurton Call of Duty for a beginner
Hello, I have a problem here, i don't know how to write a code to launch programs from a tool strip item that was gotten when the form was loaded by a mouse click, the code is: Private Sub form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load For Each filesfound As String In My.Computer.FileSystem.GetFiles("C:\", FileIO.SearchOption.SearchTopLevelOnly, "*.*") Dim fileico As Drawing.Icon = System.Drawing.Icon.ExtractAssociatedIcon(filesfound) Dim fileimage As Bitmap = fileico.ToBitmap() Dim filename As String = IO.Path.GetFileNameWithoutExtension(filesfound) Dim item As ToolStripItem = filestsmi.DropDownItems.Add(filename, fileimage) Next end su ...Show All
Hkrabben How to get DataGridView into Database
How I get this into Database Thank you. Public Class Form1 Dim PocetRiadkov As Integer Private Sub Table1BindingNavigatorSaveItem_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Me .Validate() Me .Table1BindingSource.EndEdit() Me .Table1TableAdapter.Update( Me .Database1DataSet.Table1) End Sub Private Sub Form1_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase .Load 'TODO: This line of code loads data into the 'Database1DataSet.Table1' table. You can move, or remove it, as needed. Me .Table1TableAdapter.Fill( Me .Database1DataSet.Table1) End Sub Private Sub Button1_Click( ByVal sender As System.Obj ...Show All
KevMac ICustomTypeDescriptor and the property grid.
I'd like to extend the property grid to do things such as allow me to change DisplayNames of properties at run time and to sort properties into the order that I want. I understand that I should implement ICustomTypeDescriptor but am getting nowhere. For instance the following code doesn't have any effect: <System.ComponentModel.TypeConverter( GetType (SpellingOptionsConverter))> _ Public Class SpellingOptions Implements System.ComponentModel.ICustomTypeDescriptor Public Function GetAttributes() As System.ComponentModel.AttributeCollection Implements System.ComponentModel.ICustomTypeDescriptor.GetAttributes Dim r As New System.ComponentModel.DescriptionAttribute( "UUU" ) Dim f As N ...Show All
easlern how to build .dll file from vb.net web site ?
hi i have developed a web page using file > new website step (vb.net code begind ) now i need to build that web site and get thier .dll file when i go to solution explorer and select the property pages i cant see any options to build .dll in to the debug or release folder how do i do this task regards sujithf For web related issues you may find that the forums on the asp.net site are able to provide you with a better response. forums.asp.net ...Show All
Wiz_MDK I need a delay in visual basic program
I am writing a visual basic program that display the file from a directory in a list box the app has a button which calls routines to 1. delete files in the directory 2.put some files in the directory 3. get the file info from directory and add file names to a list box here is code for step 3 my sub My .Computer.FileSystem.CurrentDirectory = "C:\mtmp" ' Create a reference to the current directory. Dim di As New DirectoryInfo(Environment.CurrentDirectory) ' Create an array representing the files in the current directory. Dim fi As FileInfo() = di.GetFiles() Dim fiTemp As FileInfo For Each fiTemp In fi ListBox1.Items.Add(fiTemp.Name) Next fiTemp end sub ...Show All
marzena DataGrid Update Command in Web Application
I when try to datagrid update get the following error. there are 3 ID columns. So my code And error ' Input string was not in a correct format.' thaks J.13.Leach but again get error. Error: Input string was not in a correct format. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.FormatException: Input string was not in a correct format. Source Error: Line 136: End Sub Line 137: Private Sub DataGrid1_UpdateCommand1(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Hand ...Show All
Diego_f Sending text to another PC
I'm trying to create a program to send messages through a network. Just one problem, I can't seem to get text to send to different Pc's. Can someone help me please! Thanks! What have you tried so far You can try using the System.Net.Sockets classes, such as TcpClient and TcpListener . They will create a communication channel and you can then send text over the channel to another PC. The example code at the links above even do something similar to what you want to do. Good luck! ...Show All
nioB How do I search the database for data and return a True or false?
I am trying to add code to check if the information in the first two TextBoxes(FirstName and LastName) is already in the database(so that I can just update it) or if the TextBoxes contain new names so that it will continue to add a new DataRow...... Private Sub SaveButton_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveButton.Click 'Create a variable for the child's photo' Dim ChildPhoto As String ChildPhoto = ChildPhotoPB.ImageLocation 'Make sure names have been entered' If TextBox1.Text = "" Or TextBox2.Text = "" Then MessageBox.Show( "Please enter a first and last name." ) Else 'Copy the information from the variab ...Show All
akin_l java in webbrowser
hello, is there any way to enable runnin java script in my browser - and if it is how can i handle them thnx; hi, yeah, im using the webbrowser contorl of .net 2.0. and i don't know what kind of java scripts i want to run fore cuz i'm writing a webbrowser application and don't know all the scripts on the net... :) you know what i mean... thnx; Are you using the .NET 2.0 (VS2005) WebBrowser Control How is it not handling the Javascript Or more importantly what is the javascript trying oto accomplish. it should be unless its disabled in the IE properties hi, i've already tried the webside using IE6 and it works fine. but in my browser i got scripting error... don't remember the content of it... :/ ...Show All
furmangg COM Object has been separated from its underlying RCW cannot be used
This is happening in a VB2005 Windows Forms app written to use existing 3rd party COM objects. All works fine in VB6, of course. The 3rd party vendor has exposed APIs to access their underlying data. Using these API objects involves instancing new objects, and logging on to them like in following pseudocode: Dim mySession As SessionObject DIM mySuite As SuiteObject mySuite = New SuiteObject mySession = mySuite.Logon(parameter, parameter, parameter) ...do things with various object(s) exposed to program... mySuite.Logoff(mySession) This last statement is what causes the error and generates the message shown in the subject. Not that I'm not trying to destroy the object, only invoke its Logoff method. This is not a multi-thr ...Show All
Ranier How to fill a DataSet with Array
Hello, I'm wondering if it's possible to fill a DataSet with a two-dimensional array. If yes I really appreciate if you can show me how. The 2-D array is created at runtime, so I don't want to create the DataColumn or DataRow at design time. THanks in advance. Michael Hi Spotty, Thank you for your reply. You answered my post too fast.. :) I review my question after I posted it and realized it was too broad. And you answered while I was editing. My array is a 2-D array. How can I add one row of the array (with multiple columns) to DataRow at once On side note: I have question about your comment that 'items can be referred by name or position index'. In your example you ...Show All
Mystagogue Visual Studio Launches Command Prompt on Build
Hey, I just noticed that my visual studio launches a command prompt on build, I just now noticed this because I set my command prompt to load up in full screen mode and now when I build it blinks black across my screen. Is there a reason visual studio needs a command prompt to launch I'm not running the application, I'm building it! :P (Ctrl+Shift+B) Do what I said above (go into command prompt and set its default to be full screen mode) and then go build your application. (It has to be an actual build, such as if you change code or use the rebuild command) When you build with C#, even in the IDE, it uses the command line compiler. This may be why you are seing your screen flash black. I can't say for sure, as I work on ...Show All
killerbambam Common Language runtime detected an invalid program
We have developed a Window Application in VB.NET (Framework 1.1) with Back-End MSDE and with Crystal Reports. We haven’t got any issue as long as we run the application in our development machine. Also we deployed it in many clients and it works fine But in only one client place, we got the following error ‘ Common Language runtime detected an invalid program’. The application contains many forms with many controls (More or less 100) But the issue comes only in one form when it is opening Configuration of the Client Machine Processor : AMD OS : XP professional We will be thankful if any one provides solution for this… Hi DMan1 Thanks for your reply. ...Show All
imanish11111 Passing a Byte Array to a COM object expecting a variant
I'm trying to pass a byte array to a COM object, SHDocVw.dll, which expects a variant variable. VB.NET won't let me do this. I understand that the variant type is no longer supported in VB.NET, and I have come accross several references to marshaling, but none that make any sense to me. Anyone have any ideas [my appologies, but as this is an urgent issue for my project, I posted this issue (sort of) on another thread with a subject meant to attract a different knowledge base - sorry for the duplication] Thanks for your comments. That at least tells me what .NET is supposed to do. However I did try that, and although it returns no errors, the post data at the web page is empty. ...Show All
jasmine pham Visual Basic Visual Studio 2005 Debug.Write doesn't work
I recently purchased Visual Studio 2005, and am trying to learn Visual Basic .net via an on-line class. Most of the less on s are very simple short programs to write messages to the Debug Output Window. For example: Public Class Form1 Private Sub Form1_MouseMove( ByVal sender As Object , ByVal e _ As System.Windows.Forms.MouseEventArgs) Debug.WriteLine(e.X & "," & e.Y & " " ) End Sub End Class However, when I run it in Debug/Start Debugging, I see nothing at all appear in the Debug Output window. I asked the instructor about it, and he has no clue, but says the code works in VB 6. Does anyone know what might cause that David ...Show All
