Answer Questions
excelthoughts Conversion of Double to Single
I've been fighting with this problem for the past couple days and finally narrowed the problem down to the following couple problems: (This is all in VS 2003 .NET 1.1) #1 I have a Generic procedure that has a ByVal parameter of a Single datatype. In one of my modules, I happen to be calling the procedure passing in a Double datatype variable that has a value of 152347.04. When I step into the procedure, the Single datatype parameter then has a value of 152347.047. I've tried type casting the Double to the Single datatype but still get the same results. I can't figure out why it's not converting over the Double to a Single type by adding some erroneous value to it. #2 Also in the same procedure, I was passing in an ArrayList object that was ...Show All
baysurfer How do you convert Integer to System.ConsoleColor with Option Strict On?
Posted on: 10/27/2006 17:01:04 I'm trying to do this, assuming the ConsoleColors have a numeric value as well as a descriptive name. But how do you convert an integer into a ConsoleColor with Option Strict On It doesn't work if I use x or y instead of sx or sy. But it does work with Option Strict Off using only x and y without sx or sy. Option Strict Off Module Module1 Sub Main() Dim x, y As Integer ', sx, sy As System.ConsoleColor For x = 0 To 15 Console.BackgroundColor = x Console.Clear() For y = 0 To 15 Console.ForegroundColor = y Console.WriteLine( "Background: {0}; Foreground: {1}" , x, y) Next y ...Show All
echavez Open USB port
I'm developing an application in VB 6.0, where I have to communicate with a device site in a USB port, but I don't know how open, write, read, and close this port in VB. If someone know how do it, or has sample code, I was very gratefull. Thank you very much! Best Regards Thanks alot Here is the info I managed to find on this topic: ---------------------------------------------------------------------- How an application accesses a USB device depends on what device driver Windows has assigned to the device. For example, if the device is a disk drive, applications can access it like any other drive. They don't have to know or care whether the drive has a USB or other interface. It's all handled at a ...Show All
guyinkalamazoo3 World clock
Hi, I am busy making a world clock program showing 5 clocks from around the world. I have a coupel of problems: 1. How do I substract hours from the system time Or is there a way to take GMT and substract/add to that time 2. If I run the program it will show my local time, but if someone from an other part of the world runs the program it will show his local time, and so the offset for other countries might be wrong... How to correct independent of location Thx for any tips you might have What version of Basic do you use, Leceur These forums are for .NET prograsmming questions only. VB6 is offtopic for these forums. Please see any of the following links for further help: Useful Lin ...Show All
enric vives Detemining the "owner" of a ContextMenuStrip
I'm working on a project that utilizes a TableLayoutPanel containing many controls. The controls can be one of three types, and each type has an associated ContextMenuStrip. I have it working where the ContextMenuStrip is applied to it's respective controls within the TLP, and can show and select items from the CMS, but need to be able to determine specifically what control was was right-clicked to show the CMS or the Point of that right click. Thanks for any help! That would work if every control had a unique ContextMenuStrip, however, it's each *type* of control that has one. If I have 20 controls of each type on the TableLayoutPanel then it will execute code against all 20 controls, where I only want ...Show All
GustavMahler The Code Did not work
WHAT IS WRONG WITH THIS CODE: When I print using Button8 it prints a blank page only . I want to print the Text File on the C drive. Imports System.IO Imports System.Drawing.Printing Imports MathCalculation Imports System Imports System.Drawing Imports System.Windows.Forms Public Class MathCalculation 'Declare num1 and Num2 as variables Public Num1, Num2 As Double Private Sub Button1_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'Assign text box values to variables Num1 = TextBox1.Text Num2 = TextBox2.Text 'Determine the checked button and calculate If RadioButton1.Ch ...Show All
Ekart Laszlo Problem about DataAdapter.Update after DataAdapter.Fill
Background: SelectCommand.CommandText = "select * from " & CurrentTargetTable & " where LogicalID =" & 1 '' The next get back the Add,Delete and Upddate command automatically Dim comOLAPBuilder As New SqlClient.SqlCommandBuilder(DataAdapter) DataAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey DataAdapter.Fill(ds,CurrentTargetTable) ''I load some data into CurrentTargetTable,that's a dataset's table successfully. ''Then I do this again. SelectCommand.CommandText = "select * from " & CurrentTargetTable & " where LogicalID =" & 2 Dim comOLAPBuilder As New SqlClient.SqlCommandBuilder(DataAdapter) DataAdapter.MissingSchemaAction = MissingSchemaAction.AddWithK ...Show All
AsifHameed1 Visual Basic Try Catch with and If Then statement
this is my code: If radioButton1.Checked = True Then textBox1.Text = textBox2.Text ^ 2 + textBox3.Text ^ 2 ElseIf radioButton2.Checked = True Then textBox1.Text = textBox2.Text ^ 2 * textBox2.Text End If Where and how would I start to put a Try Catch in here I want a MsgBox to display when a user hits the accept button with an alpha character in the textbox. Probably best to either put it outside the entire If block, or else use one for each of the conditions. If I could make a suggestion, this isn't really a situation where error-checking via exception handling is advisable. I think it would be much cleaner to just check the contents of the textboxes before using them ...Show All
Sergei Kitaev modal dialog active...
Any news on the "Microsoft Visual Studio cannot shut down because a modal dialog is active. Close the active dialog and try again." I have had this happen several times and its a pain in the butt! Hi, Just I had the same Issue, I am working with WM5 in C# env. Rakesh. Howdy - I'm sorry, but I don't think I've ever seen this issue before. Can you give us more information on how to reproduce this problem, let us know if it happens consistently, and provide a screenshot Please open up a bug on http://connect.microsoft.com/ and provide a link to the record once you've done this. Thanks, Aaron I can reproduce this at any bloody time! Open a report (rdlc) file in report designe ...Show All
MikeMorcilla Problem With Automating Outlook
I was having a problem, but I am wondering if there is a an alternative to CreateItem... I should tell you that I am using the 2003.net Standard Edition which may not have all the bells and whistles of the professional... Now here is what I want to do... Public Class Form1 Inherits System.Windows.Forms.Form # Region " Windows Form Designer generated code " Public Sub New () MyBase .New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose( ByVal disposing As Boolean ...Show All
ScaryKidsScaringKids VisualBasic.Collection vs VBA.Collection
Hi. I have ported a good chunk of my project from VB6 to VB2005. There is a VB6 COM DLL that I will not be porting over any time soon. I have a custom list class with an Add method that accepts a Collection (of strings). The list class can accept data from the COM DLL as well as Collections created within the project. Example; Dim Col as Collection Set Col = New Collection Col.Add("String1") Col.Add("String2") Call MyList.Add(Col) As well; Dim Col as Collection Set Col = DBEngine.GetListFromDatabase '//Where DBEngine is the COM DLL Call MyList.Add(Col) The problem though, is that now, under VB2k5, COM DLL's return a VBA.Collection Type, and the normal collection type is VisualBa ...Show All
beefeater Trouble Including Image Files with a Program Distribution through the Resources folder
I'm having some trouble including three image files I need via the Resources folder. In my Resources view, the only 'Persistence' options are 'Linked at compile time' and 'Embedded in .resx' - trying either one, I get a System.ArgumentException when I try to load the images from "Resources\image.gif" - I have three other images that load perfectly find from "Resources\otherimage.gif" - what am I doing wrong Yes, that'll work for viewing the program on my local machine; but I'm distributing this program, and other people aren't going to put these images in that folder. I've got images that are packed with the program from prior publishes, but I recall having more options in the 'Per ...Show All
popit "*" Question
Hi again everyone, I am back once again working on a new project. For some reason I cant seem to find the info I need so, I am back here. :) Anyways, my project... I made a text file parser... it basically opens a text file of your choice, then it searches the document for any word you specify, afterwards, it places that info in a new textbox that you can save as a new file. What I really need this app for is to parse emails. Since the emails arent the same... just the same domain... I need to be able to use the * as a wildcard. Any info on how to do this would be much appreciated. Thank you in advance, Im really sorry that I wasnt clear in my request. I was trying to make it as clear as possible. Let me try once again. Im going ...Show All
une Mouse Help...
I was thinking of Writing a help feature in a program I am making which would move the mouse pointer on the screen then the pointer will click things such as buttons or right Click thinks, Now I know there is a way to move the mouse pointer position but is there a way the cause the Mouse to Click Which Would be identicall to me actually Clicking the mouse button myself but the program does it on its own and produces the same result of actually Clicking the Mouse Button. If anyone knows how to do this I would appreciate it if you can tell me what the method or steps to making it work! take a look at this: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=780205&SiteID=1 I've updated i ...Show All
Mark Macumber save file on another have the same name :"overwrite"
hi : how can i save file overwrite on the another have the same name You can do that very easily in managed code. The following example will convert a gif to a png and overwrite any existing 'test2.png' file: Dim zBitmap As Bitmap = Bitmap.FromFile("c:\folder\test.gif") zBitmap.Save("c:\folder\test2.png", Imaging.ImageFormat.Png) I threw in the conversion as a little extra You can save the bitmap to the same format if you leave out the format-specification, or use the same format as the original file. When you are directly pointing the panel's backgroundimage to a file, then you are creating a connec ...Show All
