Hi all. I'm starting on my next part of my teach myself vb program. What I am trying to do is on button click open a textfile showing the math as it would be done long hand. I started writing the code and now I think There might be a better way of doing it than what I have been doing. Here's the code as far as it goes.
[code=vbnet]
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles...
User Profile
Collapse
-
Look at the tip o the week by Frinny he has an article on sending E-Mails via VB
hope this helps... -
Try this
place on your button
Code:Diagnostics.Process.Start("Path") ' "Path" = path to exec for calc
Leave a comment:
-
Try something like this to check if "T" is a struct
[code=vbnet]
Try
If T Is GetType(StructF ormat) Then
End If ' placed at the beginning of your class
catch ex as Exception ' placed at the end of your class
End Try
[/code]
I believe it may do what you want.
it should check as it goes along and if T becomes a struct at...Leave a comment:
-
I am assuming that the user is entering the infomation in the form with this solution.
If thats not the case ignore this.
you might consider an ontextchanged event like this
Place on the box used for entry of data
[code=vbnet]
private Sub boxname_TextCha nged(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles boxname.TextCha nged
'checking string length...Leave a comment:
-
The link did not help in my problem. I kept getting "process not defined" error and tried a few imports but to no avail. But I did get an answer from a programmer I met and all that is needed is the line
[code=vbnet]
diagnostics.pro cess.start(file name)
[/code]
very simular to what was posted.
then I discovered that I needed to import "system.diagnos tics" to do it the way posted which...Leave a comment:
-
Display a textfile created in vb using wordpad or word.
Paramiters;
vb.net 2003
XP OS
I looked and cannot seem to find a way to display a file that is created by a vb app heres what I have.
First I create the file showme.txt
This on a button click event.
I needed to delete the file if it existed first
[code=vbnet]
If File.Exists(pat h1) Then
File.Delete(pat h1)
End If
sw = File.CreateText (path1)... -
<---- Feels stupid I figured it out DUH
changed line to
line# = Line#.append(0, addspace)
works now thx anyway
delete if you want TYLeave a comment:
-
Bad append loop
Hi all!!
What I am trying to do today is write to a textfile then read from the file get some lines from that file and edit them. and re-write them to the file. Not replace I want the edited lines at the end of the file. This is all being done while the file is still open. Below is my code. I have notated it to show what I am doing.
What is happening is the length of "line#" is not increasing and not sure why... -
just post what you have on your button here and Myself or someone else can maybe solve your dellema...Leave a comment:
-
are you getting errors? is the code not doing as intended? When posting please include this type of information and anything else that might be relevent.
But to make a suggestion on your problem. Is your listview public? if not mak it public or you cannot update it from another form....Leave a comment:
-
I Believe tha is the best way using 2 boxes one to check all and 1 to uncheck all. you can still do the check on the other boxes to see if all are checked.
Happy coding
JamesLeave a comment:
-
The way you have your code written is causing the problem you are going to have to handle each checkbox seperately. like so
[code=vbnet]
' this part of the code checks to see if all others are checked and checks
' unchecks box 1 as needed (Note leave out the current checkbox your working on)
Private Sub CheckBoxChecker (ByVal sender As Object, ByVal e As System.EventArg s) Handles CheckBox2.Check edChanged
If CheckBox3.Check ed...Leave a comment:
-
(No Go) did what you said and still get "Housing not defined" error...Leave a comment:
-
Retriving Value From different form
Hi all I have a problem with getting info from another forms textbox. All the other posts I seen related to it seem to say the same thing. And do not allieviate my problem. So heres what I'm doing and have so far.
I have 2 forms the one I want to retrieve info from is called Realm and the Textbox is named Housing
Using VB.Net 2003
Here is how I am attempting to make the call.
This code is... -
Writing to a File Problem
Hi all I am having trouble with this code to write a short bit of info into an existing file. Heres what I have
[code=vbnet]
Dim MyString As String
Dim ReadString As String
Dim iFr As Short
iFr = FreeFile()
ReadString = CurDir() & "\Globals.v b"
FileOpen(iFr, 1, OpenMode.Append )
MyString = "UnlockAdd = True"
... -
For Multifract button
[code=vbnet]
Private Sub MultiFract_Clic k(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles MultiFract.Clic k
' Attempt to run the following code
Try
' If there is only a fraction entered in box1
If (space1 <= 0) Then
Numerator1 = TextBox1.Text.S ubstring(0, Slash1)
...Leave a comment:
-
Fractions code completed Part 2
Here it is cleaned up a little more.
Here's what this code does. It will take 2 fractions and add, subtract, multiply, or divide them. The user enters the fractions to be calculated into two textboxes. These can be entered as a whole number and a proper fraction, whole number and an improper fraction, just a proper/inproper fraction, or just a whole number.
Form build Requirements:
using Microsoft Visual Studio.NET... -
Ok guys thanks well heres the rest of the code.
[code=vbnet]
Private Sub MultiFract_Clic k(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles MultiFract.Clic k
' Declare my variables
Dim nummulti1 As Integer
Dim nummulti2 As Integer
Dim denmulti1 As Integer
Dim denmulti2 As Integer
Dim slash1 As Integer...Leave a comment:
-
Fraction code completed Part 1
Hi All For those of you that helped me with the questions on this... Thank you! I believe I have solved all the bugs in the code and wanted to post the final product. This is a set of code to solve basic frational arithmatic. using only 3 textboxes. Allowing the user to enter any type of fraction and get a proper reduced fraction answer. Feel Free to use it if you like it. Had to do 2 posts sorry was too long I guess.
Parameters:...
No activity results to display
Show More
Leave a comment: