Answer Questions
R.Tutus Absolute position of a control on screen
Hello All, I'm trying to find the abolute position of a control on the screen, as oposed to the relative position within a container panel or form. I wrote this bit of code which works well for objects within objects within a form: Dim ControlLeft as Integer = Me.Left Dim ControlTop as Integer = Me.Top Dim ParentObject as Object = Me.Parent Do Until TypeOf ParentObject Is Form ControlLeft += ParentObject.Left ControlTop += ParentObject.Top ParentObject = ParentObject.Parent Loop Dim FormLeft as Object = ParentObject.Left + SystemInformation.FrameBorderSize.Width Dim FormTop as Object = ParentObject.Top + SystemInformation.MinimizedWindowSize.Height ' Determine the top & ...Show All
Yogesh S browse & open file types
dear friends Plz tell me how to browse & open the fles in a program and make a program to support that type of file type and then open it. plz help me. thanks in advance Ravi yadav you have created quite a few topics....have you actually tried doing some research before hand To open the files, use the OpenFileDialog class and set your custom filters. http://msdn2.microsoft.com/en-us/library/system.windows.forms.openfiledialog.aspx Everything is in the link. Example: Dim theOFD as new OpenFileDialog() theOFD.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" if theOFD.ShowDialog() = DialogResult.OK then 'open the file selected and do whatever. The filename chosen/selected ...Show All
ronnycopeh Reverse Engineering
I have recently taken over for a programmer who has left for medical reasons. He has left a program with a few bugs and the code is nowwhere to be found. Is there a way to retrieve the code from the .exe using VB 2005, which was what it was originaly written in.. thanks Reflector is great for looking at individual methods. It will take significant work to pull out an entire solution using Reflector. Another option would be to dis-assemble the solution using ILDASM, modify the IL and re-assemble with ILASM, but that requires coding in IL rather than VB. In short, yes, it is possible, but not an insignificant undertaking. Jim Wooley http://devauthority.com/blogs/jwooley Hi, Y ...Show All
hey_ian Numbers and date format in Visual Studio Reports (.rdlc)
I am using an english version of visual studio 2005. I am from a spanish spoken country (CHILE!). Until now when I program, I can change the format of numbers and dates to the formats use in my country. The problem is that I need to format numbers in the reports that I create in visual studio. The reports are in the format .rdlc. I need that the numbers have as a decimal separator a comma (,) and as a number separator of thousands a period (.). In the case of date format, instead of showing the report the day "Monday, 12 of Febrary", I need to appear the name "Lunes 12 de febrero". How can I do this in my reports since I have a english version of the program Thanks in advance Mike ...Show All
awbliven - MSFT Connecting to Access via the wizard
I was attempting to use a DataGridView and am having troubles connecting to an Access Database. I'm running the Data Source Configuration Wizard. I get to Choose Your Data Connection. I click New Connection. I click Change. I select Microsoft Access Database File. I click OK. Here is where my problems start. My box says Add Connection. In it is a field to enter a Connection String. It also has 3 buttons -> Test Connection, OK, Cancel. And it has a disabled Advance button. I have 2 computers that show this. 2 other machines display what I expect. The box says Add Connection. It has the Change button that I clicked previously. It has the Browse button to search for my Database. It has the 3 buttons and disabled Advance butt ...Show All
PN247 Receiving strings from Serial Port
Dear reader, I want to read a string from a serial port. I found the sample code in Help, to do this, with the following code: Using com1 as IO.Ports.SerialPort = My.Computer.Ports.OpenSerialPort("COM1") do Dim Incoming as String = com1.Readline() If Incoming is NOthing then exit do Else returnStr &+ Incoming & vbCrLf end if loop end using The problem is that if the return string does not end with LineFeed, the com1.ReadLine command does not return to the application, and as a result doesn not return any value to Incoming, to check it contents. The application give the impression that it is just hanging, untill I stop the application. Also how does the Read ...Show All
Vijay_kar Stop application from terminating on form close
I am working on an application with a notify icon. I want the application to continue to run even if the user closes the form. Is there any way to make this work Ken, Is there any functional difference between using Opacity and Hide Or Visible = False I was wondering if there is a reason to choose one method over the other. I haven't tested this with a notify icon but t his should do it: Private Sub Form2_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing If e.CloseReason = CloseReason.UserClosing Then Hide() e.Cancel = True End If End Sub Note that you want to check the CloseReason property so that your app will shut down properly i ...Show All
Patrick251 Windows Service - Out of Memory Exception
I have created a windows service using vb.net which uses a filesystemwatcher to monitoe files in a specifc directory, if images are added to the directory they are resized and saved in a remote directory. The original file is then backed up and deleted from the image directory. The code is as follows Friend Shared Sub ResizeImage(ByVal path As String, ByVal filename As String) Dim asr As AppSettingsReader = New AppSettingsReader Dim sRemoteDirectory As String = CType(asr.GetValue("RemoteDirectory", GetType(String)), String) Dim sBackupDirectory As String = CType(asr.GetValue("BackupDirectory", GetType(String)), String) ' Dim img As Image = ImageFromFile(path) (This was put in as an alternative but p ...Show All
delbalso String Functions
Through playing I have noticed that whenever I type the name of a string, for example str, with a . after it a list appears with common and all functions availible. Commom: Contains EndsWith IndexOf ..... etc. I am trying to find which functin would accomodate me the best. I am currently using the .Contains to find if a specific "key" word appears in the string I just read in. But what I don't know how to do is extract data that appears after the "key" words. Can someone please help me.....!!!! Example: Itinerary for Doe,John on 01-01-1001 The informaion in yellow is the data that I need. The red ar the "key" words. Hello All. QWERTYtech: Well ...Show All
Schwarzer Schmetterling Can I create wizards for my program?
i was just wondering if I create wizards for my program like to accept input from user then process them and stuff. Yes, you can create a wizard for your program. A wizard is nothing more than a procedure (or series of procedures) that walks the user through accomplishing a task....think of a wizard as a mini application No built in controls, but this is a nice one: http://www.codeproject.com/vb/net/GNWizard.asp With that control you won't have to make multiple forms. i will try it out quite confident i can do it. but a question, then won't my program have alot of forms u said no wizard control for winforms does it mean if i use something else there is Also i w ...Show All
TheViewMaster 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
Roberto Sartori Dynamic execution method (release/debug mode)
I understand that a VB app may be compiled 2 ways (ie.,Release,Debug). Generally, we would like to use release version in production but there are times when I need to use the debug mode. I do not want to maintain two versions of exe. My application reads off data from a SQL Table so I'm thinking of leveraging that for an IF... Else statement. However, I need to know if it is possible to include the execution mode into the VB script rather than rely on the compile method. Is that possible Thanks. Hi Jade, Generally, a release version of an assembly has certain optimizations in it that make it not debuggable. Information is often optimized away that is necessary for stepping through (debugging) the ...Show All
Myke1 How can I make the font dialog work?
I made a Notepad-like application and I can't make it change fonts with the font dialog. Are you getting the font from the dialog and setting the box to have that font If FontDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then box.Font = FontDialog1.Font End If Something like that should work. Thanks, that worked. thanks also ...Show All
Oliver Berris popup menus not working
I'm using VB 6 and have a strange problem with popup menus that I can't figure out. Outline of the problem: I have two forms, say A and B. Form B is launched as a modal dialog from form A. If I use a command button on form A to launch form B (using code below), then a popup menu on form B works fine: --------- Private Sub Command1_Click() Form2.Show 1 End Sub --------- However, if I use a popup menu (menu is named "menuAddSP"; menu item is named "menuNewSP") from that same command button on form A to launch form B (using code below), that same popup menu on form B does not work - no errors or anything, ...Show All
_Matt Smith _ Array starting at One
I'm trying to make a array start at 1 and go to 600, i tryed using "to" but never worked. ReDim Preserve Array(1 to 600) no worries, glad we could all help - that's what its about! what David said is correct, it always starts from 0. Why must you have it at 1 :-) In the IDE if you do this: Dim test() as string Redim preserve test(1 to 300) the IDE will tell you, there will be a blue squiggle under "1" stating that "Array lower bounds can only be 0" I looked at it and i dont think that can help me, i want the array to start off at 1 and go up instead of 0 Ahhhh okay sorry for do ...Show All
