|
I would like to be able to browse a directory structure, open a folder, send the path to a text box and then close the dialogue box.
Does anybody know if this can be done?
Thanks
Brad
|
|
|
|
|
|
Ok, so im writing a routine to save a coordinate set to a file, and its not working, and i dont get any error messages, so i dont know why. Could anyone please tell me what im doing wrong?
-
Sub InstPT(ByVal r As Double, ByVal theta As Double)
Dim XDomain As String, YDomain As String
Dim x As Double
Dim y As Double
x = r * System.Math.Cos(theta)
y = r * System.Math.Sin(theta)
txtXCart.Text = x
txtYCart.Text = y
Dim Filename As String
Filename = "workfile.pnt"
'Dim FS As FileStream
'Try
'FS = New FileStream(Filename, FileMode.Append, FileAccess.Write)
'Catch ex As Exception
'End Try
If x >= 0 Then
XDomain = "+"
Else
XDomain = "-"
End If
If y >= 0 Then
YDomain = "+"
Else
YDomain = "-"
End If
If File.Exists(Filename) = False Then
Dim SR As StreamWriter = File.CreateText(Filename)
SR.Write("X" & XDomain & x.ToString & "Y" & YDomain & y.ToString)
SR.Close()
Else
Console.WriteLine("File exists, appending")
Dim SR As StreamWriter = File.AppendText(Filename)
SR.WriteLine("X" & XDomain & x.ToString & "Y" & YDomain & y.ToString)
SR.Close()
End If
'FS.Close()
If x > PlottingBounds.Right Or x < PlottingBounds.Left Or y > PlottingBounds.Top Or y < PlottingBounds.Bottom Then
OpenAndPlot(Filename)
Else
pton(x, y, Color.Black, PlottingBounds, 0, 0)
End If
End Sub
-
all variables are declared, and all functions exist. Thanks!
Marc Micalizzi
|
|
|
|
|
Probably, you're looking in the wrong place for the resulting file. Since you have not specified a file path, the actual location is dependant on how the code is run.
|
|
|
|
|
Shouldnt that not be a problem since i am writing to, or creating the file (if it is non-existant)? I'm running this on a PocketPC, and i searched it's entire memory for workfile.pnt, and still no results, so the problem is that it is not creating, nor writing to, the file for some reason.
|
|
|
|
|
You'r going to have to step through your code line-by-line and watch it's execution to determine where the problem is. If the code creates the file with an Open statement, don't run the next line, just go and find the file. Verify that the code is doing, and going, exactly what and where you think it should.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok, Thanks. I got it working now. I found the error, it was in another routine and it was trying to convert too much of the string to an integer. (in otherwords it included 1 too many characters being either an "X" or a "Y" lol)
|
|
|
|
|
Hi,
Does anyone know how to wake a PC that has gone into suspend mode? I know there are things like Wake-on-LAN, but I am trying to wake a PC at a specific time that has gone into suspend mode and that is not on a network at all. I assume there is some way to tap into the advanced power config interface. I have managed to get an application that fires up at a specific time, but I need to get the timer to keep going even if the PC goes into standby, because at the moment the application I wrote does not start once my PC goes into standby.
Any pointers and tips will be greatly apreciated
Thanks
|
|
|
|
|
I have no examples on how to do this, but, in theory, you register your app with the power manager with a description of the minimum power configuration your app will tolerate. Being an app that is constantly running, I don't think your app will tolerate the machine going to sleep at all. The power manager has no wake-on-schedule support.
But, the description of the Power API's begins here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
This is what I am trying to accomplish:
Specify a number "123"
Look for that number in the database.
If found, read everything in that row.
If not found, append the info into the database.
I am getting close to being able to read the database but have no clue how to write to it.
Is there anyone out there that may have a simple example of how to read and write to an access database?
Thanks in advance.
Beginner in VB.NET
|
|
|
|
|
Well, let's see what you've got so far and we'll see what we can do about adapting what you have for writing and pointing you in the right direction.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Private Sub Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button.Click
Dim DS As New DataSet()
Dim Command As String = "SELECT * FROM Database WHERE Number1 = '" & cboNumber1.Text & "' AND Number2 = '" & cboNumber2.Text & "' AND Number3 = '" & cboNumber3.Text & "'"
Dim Adapter As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(Command, Connection)
Dim CMDBuilder As OleDb.OleDbCommandBuilder = New OleDb.OleDbCommandBuilder(Adapter)
Dim I As Integer
On Error Resume Next
If cboNumber4.Text = "" Then
Connection.Open()
Adapter.Fill(DS)
For I = 0 To DS.Tables(0).Rows.Count - 1
cboNumber4.Text = DS.Tables(0).Rows(I).Item(3)
cboNumber5.Text = DS.Tables(0).Rows(I).Item(4)
cboNumber6.Text = DS.Tables(0).Rows(I).Item(5)
Next
Else
Adapter.UpdateCommand = CMDBuilder.GetUpdateCommand()
Adapter.Update(DS.Tables(0))
End If
End Sub If the first three numbers are there then the other two are put onto the screen using comboboxes.
Here is my problem:
If cboNumber4.Text = "" then
search the database and if found write to cboNumber4.text and cboNumber5.text
If it isn't found then I need to choose the fourth and fifth number and then add all five numbers to the database.
Maybe I should do this procedure in another button, since I have to manually choose the fourth and fifth number and then add them all to the database.
Any suggestions? Thanks.
Beginner in VB.NET
|
|
|
|
|
Britnt7 wrote:
Here is my problem:
If cboNumber4.Text = "" then
search the database and if found write to cboNumber4.text and cboNumber5.text
If it isn't found then I need to choose the fourth and fifth number and then add all five numbers to the database.
Maybe I should do this procedure in another button, since I have to manually choose the fourth and fifth number and then add them all to the database.
Any suggestions? Thanks.
Huh? Let's see if I get this straight. You have 5 ComboBox's on a form. The use then picks numbers from each of these CB's, ComboBox1, ComboBox2, and ComboBox3. When all 3 of these ComboBox's have a value, the user clicks a button. ComboBox4 is then checked to see if it has a selected value. If it does not have one, the database is queried to see if it has the numbers selected in ComboBox's 1, 2 and 3.
If the numbers do NOT exist in the database, then ComboBox's 4 and 5 are enabled and the user gets to pick numbers from those two ComboBox's. Then the user clicks another button to write the values of all 5 ComboBox's to the database.
Else if the numbers DO exist in the database, then ComboBox's 4 and 5 are populated with the database values.
Correct?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Correct.
I could not of said it any better myself. As of now, the code I supplied earlier, checks the database and if found writes the values of ComboBox4 and ComboBox5. The part I need help with is: if it isn't found add the two numbers on the screen and then write it to the database.
Can you help? Please feel free to change any of this as long as I get the end result:"Search for the first three numbers in a database, if found show the other two, if not found add two numbers and the write it to the database."
Thanks again.
|
|
|
|
|
I am using VB.NET to develop an Outlook COM Add-In and require the addition of a custom property page. The process requires that I create my page as an ActiveX component which can then be added to the PropertyPages collection.
It appears that there is no way to create the required ActiveX object with VB.NET. Thus, the only way to create a custom property page for Outlook is to use VB6 or C++.
Is it possible to use VB.NET to create an object that can be added to the Outlook PropertyPages Collection?
RichSolutions
|
|
|
|
|
hi,
i want to send mail by using VB.net,
bau it dosen't know system.web.mail,
please tell me what should i do?
|
|
|
|
|
It doesn't know System.Web.Mail? Or YOU don't know System.Web.Mail?
It's really quite easy:
Imports System.Web.Mail
.
.
.
Dim Message As New MailMessage()
Message.To = "someone@whoknowswhere.com"
Message.From = "me@myhouse.com"
Message.Subject = "Who cares"
Message.Body = "I don't know what I'm supposed to say..."
SmtpMail.SmtpServer = "smtpmailserver.myISP.com"
SmtpMail.Send(Message)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I had developed one message system by using winsok in vb .now I want to run my application into system tray and when any message is revieved at that time that application will flash on the screen.
can any body help? if possible give me code pls.
Thanks in advance
|
|
|
|
|
This should have been taken into account before you started your project. "In the System Tray" is not a special place where your app runs. It's just a place to put a Notification Icon. See NotifyIcon XP[^] on GotDotNet for a really good NotifyIcon class you can use.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
NotifyIcon[^] class documentation on MSDN. Comes complete with an example too.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how character images can be segmented.
how can i interface my scanner through vb.net
saud
|
|
|
|
|
Stop it! If you want to write your own OCR software, you've got A LOT of RESEARCH to do before you can even get started. If you knew what you were doing with the technology behind OCR, you wouldn't be asking us this question, over and over and over again. Your asking about the basics behind OCR, which alone is a VERY complicated topic and well beyond the scope of this, or any Forum on CodeProject.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
WOuld've thought that you'll find it difficult to find a disassembler for VB6 project, unless it's been complied to P-CODE....
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
There is no decoder. If you try and disassemble the .EXE, you'll get back a bunch of assembly code, NOT your original source.
...and stop YELLING...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
If I have a propertygrid and I set its SelectedObject to nothing:
PropertyGrid1.SelectedObject = nothing
why would it continue to show the properties of the object I had set it to before setting it to nothing?
Rugby League: The Greatest Game Of All.
|
|
|
|