|
Well, it could be done, but the image is still going to be skewed and look funny, but the circles will look just like circles.
Wouldn't it be faster to setup the dart board again and put the camera on a tripod and raise it so the center of the lens is the same height as the bullseye??
|
|
|
|
|
Sounds good but most of the darts will hit the camera
|
|
|
|
|
Hi Friend,
I am using MSAccess database and VB Data Environmental datareport(vb datareport)
i don't have serial number as a field in the database table.
But in VB Data Environmental datareport(vb datareport)
i need to display serial number.
That report will display only one person's information.how to give that serail number. Here is my sample database table.
Nam id feename amt
----------------------------------
AAA 11 Tution1 100
AAA 11 Tution2 100
AAA 11 Tution3 100
BBB 12 Tution1 100
BBB 12 Tution2 100
BBB 12 Tution3 100
BBB 12 Tution4 100
CCC 13 Tution1 100
CCC 13 Tution2 100
CCC 13 Tution3 100
DDD 14 Tution1 100
DDD 14 Tution2 100
Kindly help me.
Expectd Output in DataReport is
Sno Nam id feename amt
----------------------------------------
1 AAA 11 Tution1 100
2 AAA 11 Tution2 100
3 AAA 11 Tution3 100
----------------------------------------
Sno Nam id feename amt
----------------------------------------
1 BBB 12 Tution1 100
2 BBB 12 Tution2 100
3 BBB 12 Tution3 100
modified 29-Feb-12 5:12am.
|
|
|
|
|
If you mean adding record numbers to a report here is an article that may help:
Counting in reports[^]
|
|
|
|
|
It is working in ms access datareport but am asking about VB Data Environmental datareport(vb datareport)
modified 29-Feb-12 23:41pm.
|
|
|
|
|
Hi all
I am very new at programming anf I would like to do a very basic function, to change the label.text thru some code.
The following code does not work but it will give you the basic idea of what I want done
For i = 1 To number
Label(i).text = i
Next
The reason is that my label will change in function of the day of the month
Thank and keep up the good work.
asp
|
|
|
|
|
It works. The problem is that your code is running on the UI thread and blocks it so the WM_PAINT messages that are tacking up in your apps message queue don't get processed. That means that your label control is not receiving the Paint messages until after your code is done and your app is idle. That's when the label gets repainted.
Also, what's with the Label() array?? Is this VB6 you're using?? If so, stop now and get VB.NET Express. It's free and you won't be teaching yourself some very bad habits forced on your by VB6.
|
|
|
|
|
Ok Thanks for your answer
I found how to do it with
ctrlDict("label" & i).text
|
|
|
|
|
Yeah, but that's not the best way to do it.
|
|
|
|
|
Thank you all for your help.
I know it's probably not the best way to do it, by creating a dictionnary, but since my project is small, it does the job for now. When I get better at coding I will look at other ways to do it.
PS I am using Visual Studio 2010 ultimate.
I have another question but I will post another thread
Again thanks
|
|
|
|
|
AlainStP wrote: I know it's probably not the best way to do it, by creating a dictionnary
Thats not a dictionary. It's an array. The two are very different in their functionality and if you start using the incorrct terminology when referring to thi \sstuff in forums, you'll end up confusing people.
|
|
|
|
|
Good reply. Get VB.NET.......
|
|
|
|
|
|
How to check the status of printer connected to serial port directly and doesn't installed as Windows printer. I want to check the status like paper out, offline/online for POS Thermal receipt printers connected to Serial port.
Thanks
|
|
|
|
|
You'll have to talk to the printer, obviously. Get out the manual on it to find out what you have to send and what you should get back to find the status.
|
|
|
|
|
Thanks Dave, I Have to check the status of STAR Thermal Printer & the command is ENQ (Decimal value 4) which returns 1 byte message and the status depends upon the values of bits (which can be compared). I use MSComm control & use the output function to send the command (ENQ) & Input function to get the status message. But input function only receive message when the printer is turned OFF or ON. I would like to know do I have to set the RThreshold property value of MSComm control as by default it is 0, if so at what value should I set it to receive the status message instatntly?
|
|
|
|
|
Does this[^] help? Ir was the first Google hit for RThreshold mscomm.
|
|
|
|
|
i have this code on a form :
Function f1 as boolean
Try
------------
-----------
if condition
return true
else
return false
end if
Catch ex as Exception
Me.close
End try
End function
Private sub s1
if f1 then
instruction 1
else
instruction 2
end if
End sub
But if an exception occur inside f1 , the instruction Me.close
doesn't close the form instantly , but after instruction 2 on s1 sub is executed. How can i do to close the form instantly?
Thank you!
|
|
|
|
|
Assuming you are talking about WinForms, and sub s1 is called from inside some handler (say a button click handler) that behavior is what they intended it to be. Form.Close() does not actually close the Form, it merely queues a request to close the Form; which will be handled when the main thread (on which your button click handler is executing right now) gets around to it. And even then, it will first fire a FormClosing event, and then close the Form, and finally fire the FormClosed event. This is a common pattern in Windows and its event mechanism.
What you could do inside function f1 is either not catch the exception, or throw a new one; and then try-catch in sub s1 and do (or not do) as you please.
Please keep in mind that often functions are supposed to calculate something and return the result, and NOT to cause side effects (such as closing a Form). When you deviate from that, you have to take full responsibility and bear the consequences.
|
|
|
|
|
Hello !
I have an application in VB.net 2010 / Entity Framework with database in SQL server 2008R2. The application works , but doesn't handle the situation when connection with server is lost during a transaction.For example if i press a button that select some records from database but before the sql server for example become innaccesible on network , the application crash. I want to handle this situation to keep running the application and display only error messages.I start to modify my code and adding Try...Catch blocks.But sometime i don't know where is better to put try... Catch and what to do with the form where the exception occur.For example :
---------------------
Private sub ......
Instruction 1
Instruction 2
...
instruction 5 ( Read from database)
Instruction 6
----
instruction 8 ( Write to database
------
-----
End sub
So is better to start try on the beginning of sub and End try to the end of sub ?The problem is that instruction 1,2,3,4 do something on the form and if instruction 5 has exception and is not executed the form may have wrong data and the instruction 8 if is executed correctly ( for example if the connection with server is ok on this instruction) may have other errors because instruction 5 is not executed.So can you suggest that is better to close the form if an exception (lost sql server connection) occur ?
Can you give me a suggestion?
yhank you.
modified 23-Feb-12 16:55pm.
|
|
|
|
|
The best advice here is not to mingle GUI code and your database operations; keep them well apart, in different methods, if not different classes. And then insert try-catch blocks that catch those exceptions you can deal with, and NOT the ones you cannot handle at that level. The ones you can't handle should ripple through to the caller, hoping he would know what to do with them.
Example: if you write a method that should delete a file, you'd use File.Delete inside a try block inside a loop; the loop is needed because the delete might fail as helper programs (disk indexers, search tools, ...) might be reading the file and have it locked. So the code might look like this (in a pseudo-code which resembles C#):
deleteFile(string filename) {
for(int tries=5; i>=0; i--) {
try {
File.Delete(filename);
return;
} catch (IOException) {
if (i>0) Thread.Sleep(100);
else throw;
}
}
}
In this example, "dealing with the problem" meant retrying it a couple of times.
If the retry loop is a surprise, know that Windows Explorer does this in a similar way; it is why it takes several seconds before you get a failure notice when it is unable to delete a file...
|
|
|
|
|
Thank you !
But my application work with a sql server.And if a have this block ( is excecuted when i press a button):
Try
.....Read something from sql server
Catch ex as exception
.... Dispaly an error message
end try
i noticed that when the sql server is not ready on network , when i press the button for the first time the error message display very fast.If i try again to press the button ( and the server is again not ready) the error message display after some time .
|
|
|
|
|
alejx wrote: If i try again to press the button ( and the server is again not ready) the error message display after some time .
15 seconds[^].
Bastard Programmer from Hell
|
|
|
|
|
But why on the first time the message is displayed instantly?
The button do the same thing on first and ather times
|
|
|
|
|
Put a breakpoint in there and see what the connection-timeout is. I'd guess that the first time it'd be initialized to 0.
Bastard Programmer from Hell
|
|
|
|