|
Hi ChandraRam,
Thanks for your quick reply. My page size is 8.5x11. Page Units = Inches. Orientation in Portrait. I originally had the margins set at .5 for all, but I also tried changing them all to 0 with no change in the resulting number of pages.
In designing my report I used the Report Ruler to ensure that my data is only setup between 1 inch on the left and 7inch on the right. I used a Rectangle control to contain the different sections of my form so I can insure that each rectangle is only 6 inches long, starting at 1 inch on the right and all my field data is contained within a rectangle control. I am currently not specifying page breaks in the properties of any of my rectangle controls, although I did try to add a page break property on some rectangles which did not affect the additional page breaks when printing.
So my issue now is how can I determine what is specifically causing a page break.
|
|
|
|
|
my pc's operating system
windows 7 ultimate 32 bit
-------------------------
i am working on a project that will control 5 devices through pc parallel port/printer port.
when i run the program it will first appear a loginform
then when i enter.
it always returns that the port doesnt exist.
even though i have the port it cant detect it.. i dont know what is wrong with my code.
--------------------------------------------------------
Dim FILE_NAME As String = "LPT1"
If System.IO.File.Exists(FILE_NAME) Then
Dim objWriter As New System.IO.StreamWriter(FILE_NAME)
objWriter.Write("hi")
objWriter.Close()
MsgBox("ok")
Else
MsgBox("port does not exist")
End If
------------------------------------------------------
then after the login the next form is homepage. there you'll see the switch buttons that will turn on and off a device. when i clicked any of this buttons an error will prompt. its say that object reference not set to an instance of an object
NullReferenceException was unhandled.
Private Sub btn_app1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_app1.Click
If btn_app1.Text = "ON" Then
btn_app1.Text = "OFF"
btn_app1.BackColor = Color.Red
io(0)
Else
btn_app1.Text = "ON"
btn_app1.BackColor = Color.Green
io(1)
End If
End Sub
Private Sub btn_app2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_app2.Click
If btn_app2.Text = "ON" Then
btn_app2.Text = "OFF"
btn_app2.BackColor = Color.Red
io(0)
Else
btn_app2.Text = "ON"
btn_app2.BackColor = Color.Green
io(2)
End If
End Sub
Private Sub btn_app3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_app3.Click
If btn_app3.Text = "ON" Then
btn_app3.Text = "OFF"
btn_app3.BackColor = Color.Red
io(0)
Else
btn_app3.Text = "ON"
btn_app3.BackColor = Color.Green
io(4)
End If
End Sub
Private Sub btn_app4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_app4.Click
If btn_app4.Text = "ON" Then
btn_app4.Text = "OFF"
btn_app4.BackColor = Color.Red
io(0)
Else
btn_app4.Text = "ON"
btn_app4.BackColor = Color.Green
io(8)
End If
End Sub
Private Sub btn_app5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_app5.Click
If btn_app5.Text = "ON" Then
btn_app5.Text = "OFF"
btn_app5.BackColor = Color.Red
io(0)
Else
btn_app5.Text = "ON"
btn_app5.BackColor = Color.Green
io(16)
End If
End Sub
Private Sub io(ByVal bit As Integer)
val = axHwinterface1.InPort(888)
axHwinterface1.OutPort(888, CShort(val Or bit))
End Sub
--------------------------------------------------------
please help me im new in this.. i need your help guys.. thank you in advance..
every response is very much appreciated
if you want to see my whole project you can Download it here
http://www.mediafire.com/?1zvx1ty736r2nnb
|
|
|
|
|
There is an important and great technology: it's called debugging .
Set a break point somewhere in your code, e.g at Private Sub btn_app1_Click(...) and then run the code step by step. Thus you will detect the line of code where the exception is thrown.
I guess it happens at Private Sub io(...) . Either axHwinterface1 is Nothing , or InPort(888 ) returns Nothing , then the next line fails.
Debugging will tell you the exact reason.
|
|
|
|
|
thank you for the reply Mr. Bernhard.. im sorry but i don't know exactly how to debug it i need a lot of information to understand the errors. i know that i dont know a lot of things in VB but im willing to learn, im still a student.
thank very much you sir for the advice. i'll tell you i comes up with a solution.
|
|
|
|
|
Take a look here[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
thank you for your reply Mr.Richard
in the link you gave me. do i need all that codes in my project? im sorry but some of its content is new to me.
hope you can help me what to add in my project.
i'll try test those code in the link if it will make my device work.
thank you again.. looking forward for you reply.
|
|
|
|
|
Sorry I don't know. You need to read the article and the code and figure out how much of it you need in your project. It largely depends on which parts you are having difficulty with.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
its ok.. i'll just read the article..
im wonder if i can do this in time but.i hope i'll found out the solution as soon as possible
i just learn vb in tutorials. and i dont see any tutorials about my project thats why im having a hard time figuring out things just by myself.
thank you again Mr. Richard all of your reply is very much appreciated.
|
|
|
|
|
Lord Christian wrote: i just learn vb in tutorials. and i dont see any tutorials about my project If you are just learning then this seems a rather ambitious project. Also, you cannot guarantee that a tutorial will exist for every possible combination of circumstances, that is why developers need to practice their skills all the time.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
i know this is an ambitious project.
But the good part is if i make it, i can say it is the biggest project that i achieve.
yes it will take a lot of time to finish this in my current intelligence state.
but still i'm very desperate of finishing this project. if this project became successful im gonna post an article about it here.
|
|
|
|
|
When I said this was an ambitious project, I did not mean to suggest that you should abandon it completely. Rather, that you should focus on some simpler projects in order to increase your knowledge and experience. Once you are fully comfortable with the language, the framework and the hardware platform, then come back to this project and continue. And writing an article about your final project when it is working is an excellent idea.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thank you sir for your advice. Your right i should go for simpler projects. i guess im gonna take your advice. i'll let you know if i have questions in my future projects
|
|
|
|
|
Hello,
Any body knows how to run visual basic program using
matlab COM Object ?
http://www.codeproject.com/Articles/6236/Building-COM-Components-Using-MATLAB-Part-I
Regards.
|
|
|
|
|
The same way you run other applications from MatLab. There's an example here[^].
|
|
|
|
|
|
VB6 is no longer supported.
|
|
|
|
|
When debugging user control, having Subclass handler, put your mouse on the user control not clicking, Sub zSubclass_Proc has promptly run, how to troubleshoot? is there a way that I can right-click on an object then run to? anyone knows please help.
|
|
|
|
|
If the user control code is within your project (not an OCX included), why not open it and set break points where required? The code execution will be interrupted at the break point even during design mode, if I am not mistaken...
HTH
Happiness will never come to those who fail to appreciate what they already have. -Anon
|
|
|
|
|
Welcome. Could someone help me in making Downloader?.
I'd like to pretend downloads. I do not want to download only to show, revealing the action "progress bar" and increase kb / s or mb / s ?
Regards.
|
|
|
|
|
Have a look at an article I wrote -> Application Auto-update via Online Files in C#[^].
It is in C# but you should be able to understand it and convert it to VB fairly easily.
There is a progress bar within the application that shows the progress of the download.
Regards
Guy
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
modified 9-Jan-13 6:40am.
|
|
|
|
|
You could do a downloader and send me a project and I would be opened in the Visual Basic?
|
|
|
|
|
Give the article and project a look and get back to me if you have specific questions about it
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
Hello,
Im stock at this problem i got an error "The I/O operation has been aborted because of either a thread exit or an application request."
i got an error on this line
mySerialPort.WriteLine("SUCCESS!" & vbCrLf )
and here is my code.
Public Sub CommPortSetup()
If mySerialPort.IsOpen Then
mySerialPort.Close()
End If
Try
With mySerialPort
.PortName = "COM1"
.BaudRate = 115200
.DataBits = 8
.Parity = Parity.None
.StopBits = StopBits.One
.Handshake = Handshake.None
.DtrEnable = True
.RtsEnable = True
.NewLine = vbCrLf
End With
mySerialPort.Open()
MessageBox.Show("Connected to COMMPORT1")
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
mySerialPort.WriteLine("AT+CMGF=1" & vbCrLf)
System.Threading.Thread.Sleep(200)
mySerialPort.WriteLine("AT+CMGS=+6390720831187" & vbCrLf)
System.Threading.Thread.Sleep(200)
mySerialPort.WriteLine("SUCCESS!" & vbCrLf )
System.Threading.Thread.Sleep(200)
End Sub
End Module
|
|
|
|
|
What's with all the Thread.Sleep garbage?
|
|
|
|
|
I get rid of the "thread.sleep" for now,
but I got these error "An unhandled exception of type 'System.ExecutionEngineException' occured in Unknown Module.
Please help me.
|
|
|
|