|
Well you could use Me.ClientRectangle rather than constructing a new rectangle which would save creating three variables.
Maybe go straight from Me.Width to tripsToInches thereby knocking out another variable.
I would also recommend using Me.Font and Me.ForeColor rather than hard coding it so the font decision can be left to the calling code, though fixing the size is probably sensible.
All pretty minor, I had to think to spot these ideas, and they are only ideas.
Basically I can't fault it. Good work.
|
|
|
|
|
That's what I mean The Man from U.N.C.L.E.!
I need Ideas to make this ruler perfect and its not a copy I am trying myself that's why coding is poor 
|
|
|
|
|
|
Hello to All,
Actually i am using a component for Export into Excel . Some time for special value component will be crash and Software generate the error message and Application Will be crash.
So Please help me regarding that how to stop error or how to stop Component crashing.If you can think then I Can.
|
|
|
|
|
is it a third party component or your own devloped component , if your own component then what are those special values ,Try this Code project article if you dont have component code
Export 2 Excel In .Net[^]Best Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
Yes it is a third party component. and IT is a Control(Visual) on our form.
and It is not for Exporting into Excel. It Shows GUI OF CONTROL for Multiple Purpose.
Thanks for your suggestions.If you can think then I Can.
|
|
|
|
|
I can barely understand what your saying (I think!)
If it's a third party control you're having problems with, your best source of information and support would be the people who wrote the control.
There is no "one fix" that going to stop a control from crashing.
|
|
|
|
|
Thanks Dave,
Actually i want to know that the error only stop from source site.If you can think then I Can.
|
|
|
|
|
HI all
I need to open and program Powermill programs in vb
anyone to help me??
Regards
Gany
|
|
|
|
|
Did you try the forums on their site[^]? That would be your best chance.
|
|
|
|
|
First, never heard of "Powermill".
Second, "opening and program Powermill programs" isn't relaly a specification or good requirement definition. It's WAY too general and does not lend itself to a good answer.
What do you want this thing to do? Let someone edit the program as text? Show a graphical representation of the program? 3D modeling with primitives? ... What?
|
|
|
|
|
i hope so VB means .net not vb6 try the SDK for powermill and also check the Com/ libraries in refrences Best Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
When I use the following the code to print in prints on one line. How do I put a hard return at the end of each line. So I can have different more than one line.
Private Sub PrintDocument1_PrintPage_1(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
For Me.counter = 0 To 19
e.Graphics.DrawString(writeline(Me.counter), printFont, _
System.Drawing.Brushes.Black, 10, 10)
Next Me.counter
End Sub
by using the follow code resolved the issues
Dim strPrint As New StringBuilder
For Me.counter = 0 To 19
strPrint.Append(printline(Me.counter) & vbCrLf)
Next Me.counter
e.Graphics.DrawString(strPrint.ToString, printFont, System.Drawing.Brushes.Black, 10, 10)
If System.IO.File.Exists(SaveFileDialog1.FileName) Then
printfile = File.OpenText(SaveFileDialog1.FileName)
printfile = System.IO.File.OpenText(SaveFileDialog1.FileName)
Do Until printfile.Peek = -1
menuitem(printcounter) = printfile.ReadLine
e.Graphics.DrawString(printfile.ReadLine, printFont, _
System.Drawing.Brushes.Black, 10, 10)
printcounter = printcounter + 1
Loop
printfile.Close()
End If
now the problem is tab spacing.modified on Thursday, March 11, 2010 1:40 PM
|
|
|
|
|
You need to add a line feed char at the end of each line. Try this :
For Me.counter = 0 To 19
e.Graphics.DrawString(WriteLine(Me.counter & vbCrLf), printFont, System.Drawing.Brushes.Black, 10, 10)
Next Me.counter
Hope this helps.
[EDIT]
Sorry that won't work either. That will print one line on top of another. The best eway to do this is with a stringbuilder like this :
Dim strPrint As New StringBuilder
For Me.counter = 0 To 19
strPrint.Append(counter & vbCrLf)
Next Me.counter
e.Graphics.DrawString(strPrint.ToString, New Font("Ariel", 12), System.Drawing.Brushes.Black, 10, 10)
you will need to import System.Text into your class.
Hope THIS helps.
[/EDIT]modified on Wednesday, March 10, 2010 9:12 PM
|
|
|
|
|
I have tried hard coding the hard return the string array but still did not work.
|
|
|
|
|
Sorry, I don't quite get what you mean, although I tried a test and my second example works perfectly. The only thing was a typo in the font declaration, "Ariel" should be "Arial".
|
|
|
|
|
why are we appending the counter which is an index of the wriline string array.
Dim strPrint As New StringBuilder
For Me.counter = 0 To 19
strPrint.Append(counter & vbCrLf)
Next Me.counter
e.Graphics.DrawString(strPrint.ToString, New Font("Ariel", 12), System.Drawing.Brushes.Black, 10, 10)
should be
<pre><code> Dim strPrint As New StringBuilder
For Me.counter = 0 To 19
strPrint.Append(writeline(me.counter) & vbCrLf)
Next Me.counter
e.Graphics.DrawString(strPrint.ToString, New Font("Ariel", 12), System.Drawing.Brushes.Black, 10, 10)</code></pre>
|
|
|
|
|
You can Check it to Paste it Code to Print Preview Control. If you can think then I Can.
|
|
|
|
|
please... can anyone help me... how to code checkboxes within a datagridview for VB.net... in returning borrowed materials, you can choose to check all or check/unchecked individually and when you click the return button the checked checkboxes corresponding information will be stored to your database... thanks...
|
|
|
|
|
|
Experts
I have an inbuilt web browser with a fairly simple web page. I some text that is needed to go from the web browser onto the vb.net document which the web browser is on. (hopefully that makes sense)
I have looked around but can't seem to find anything.
Imagine someone highlighting the text presing ctrl c in the web browser and then in the .net doc ctrl v, this is what i want to do but automatically.
Any help would be great
Cheers
Dan
|
|
|
|
|
You can access the clipboard by using the My.Computer.Clipboard object. You would still need an event to use to copy and paste (maybe using buttons). Ctrl-c, and Ctrl-v automatically work as intended on both Browser and Textbox contrtols.
|
|
|
|
|
Hi,
i am new for this.
I am trying to compile an old VB project but it is giving error in
a line like [Can't find Project Or Library]
strdate = Format(Now,"YYYY-MM-DD-HH.MM.SS")
why it is giving this error . do i need to add any reference for this.
please help me
Thanks
![Rose | [Rose]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
no "-" after DD
strdate = Format(Now,"YYYY-MM-DD HH.MM.SS")
and also check by going to your references , it will show you the missing Project Library starting with the word Missing that is there any lib missing also or not. Best Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
Ya it shows the MISSING : APEX Array Object
it refers to xarray32.ocx
but i thought it is other problem.is it ?
|
|
|
|