|
Excuse the sarcasm - we really need a rude/sarcasm icon
You know how to use the stream writer
You are using writeline - I assume you can count to 10
If you cannot add 10 spaces to the left of the textbox.text then there is no hope at all.
when finished remember to add stream.close() (you don't need flush() - thank you Luc).
I hope I'm not feeding a troll, your question is so basic it does make me wonder.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I tryed that it did not work just just moves right back i guess it would probably be easyer using a excel spredcheet and remove the lins when printing
|
|
|
|
|
I regret the inconvenience caused with the lengthy code pasted earlier.I'll put my query again.
I am using a front end to enter some records.However for a particular record the update button is greyed out.
code for update button.
Private Sub cmdUpdate0_Click()
Dim strAgreeStatus As String
Call m_frmParent.ZOrder(0)
strAgreeStatus = txtText0(idxMaintAgreeStatus).Text
If Edit_Neg > 0 Then
Exit Sub
End If
If Edit_Agree > 0 Then
Exit Sub
End If
On Error GoTo ERR_ROUTINE
Me.MousePointer = vbHourglass
If strAgreeStatus = "A" Then
m_objAgreement.DoFullEdits = "Y"
Else
m_objAgreement.DoFullEdits = "N"
End If
FMain.staMain.Panels(1).Text = ""
DoEvents
If ValidateAll0 > 0 Then
FMain.staMain.Panels(1).Text = "Unable to Update. Check fields in red."
GoTo SUBEND
End If
DoEvents
If m_objAgreement.Update < 1 Then
Call MsgBox("Agreement not found. " & vbCrLf & _
"", vbExclamation & vbOKOnly, "Unable to Update.")
Else
cboCombo0(idxMaintAgreementType).SetFocus
FMain.staMain.Panels(1).Text = "Update Successful."
End If
SUBEND:
cboCombo0(idxMaintAgreementType).SetFocus
Me.MousePointer = vbNormal
Exit Sub
ERR_ROUTINE:
If Err.Number = boAgreeErrRequired Then
Call MsgBox("Unable to Update. " & vbCrLf & vbCrLf & Err.Description, vbOKOnly, "Required Data Missing")
ElseIf Err.Number = boAgreeErrValidation Then
Call MsgBox("Unable to Update. " & vbCrLf & vbCrLf & Err.Description, vbOKOnly, "Data Validation Error")
Else
Call MsgBox("Unable to Update. " & vbCrLf & vbCrLf & Err.Description, vbOKOnly, "Error")
End If
Me.MousePointer = vbNormal
End Sub
Thanks in advance.
~Varun
|
|
|
|
|
From what you have said, I do not believe the problem is within the click event of the updaste Button.
I would suggest you use a breakpoint and step through you code and pay particular notice to anything where the Enabled property of the update button is used.
I noticed you used a GoTo command. Tut Tut, bad coding. Avoid using them, they only lead to bad code.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Thanks for your response Steve..Havn't tried it yet but definitely share it with you..Regarding the GoTo..well the code is legacy code so can't do much
Thanks
~Varun
|
|
|
|
|
Thanks a ton Steve.. My problem has been solved after a little exploration in the enable conditions.
Regards
Varun
|
|
|
|
|
Buggedforever wrote: DoEvents
Eeekkk
Buggedforever wrote: On Error GoTo ERR_ROUTINE
AAHHHHhhhh
Buggedforever wrote: GoTo SUBEND
AAAHHhhhhhh
Sorry, I was not expecting VB6, I need a shower, ergh.
There is a rule that discourages answerers from being sarcastic and rude but I just can't help it - VB6 make my skin crawl.
|
|
|
|
|
Mycroft Holmes wrote: I was not expecting VB6
Took me a couple of seconds to recoil in horror myself
I don't speak Idiot - please talk slowly and clearly
I don't know what all the fuss is about with America getting it's first black president. Zimbabwe's had one for years and he's sh*t. - Percy Drake , Shrewsbury
Driven to the arms of Heineken by the wife
|
|
|
|
|
hi,
I have a numericupdown control, I want users be able to increase its value by 0.15 (15 minutes)
and when it reaches 60 it becomes 1,
actually it works but only when user increase it, for example if its 1.30 and user decrease it it will be 0.85, I know my code has problem but I dont know how to solve it
can someone help me?
|
|
|
|
|
Shaahinm wrote: can someone help me?
Only if you post your code.
Alan.
|
|
|
|
|
Dim s As Decimal = 0.6
Private Sub nupS_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nupS.ValueChanged
If (nupS.Value Mod s) = 0 Then
nupS.Value = CDec(CInt(nupS.Value))
s += 1
End If
End Sub
|
|
|
|
|
And what is the problem?
if you set the step value to 0.15 it would increment like so:
0.00
0.15
0.30
0.45
0.60 assume this magically changes into 1.00
1.15
1.30
1.45
1.60 magic required ==> 2.0
and decrement like this:
2.30
2.15
2.00
1.85 assume this magically changes into 1.45
1.30
1.15
1.00
0.85 magic required ==> 0.45
0.30
0.15
0.00
So all that is needed is two lines of code, according to these rules:
if fraction==0.60 add +0.40
if fraction==0.85 add -0.40
Put something to that effect inside the valuechanged handler.
Warning: if the control would allow a paste, all kinds of nasty things could happen...
|
|
|
|
|
thank you man,
the problem is that I am not able to find out whether user is increasing the value or decreasing it
Should I store its value and check it when the value changed???
or is it possible to use delegates and events.
|
|
|
|
|
Shaahinm wrote: the problem is that I am not able to find out whether user is increasing the value or decreasing it
did I need that information in the two rules:
if fraction==0.60 add +0.40
if fraction==0.85 add -0.40
???
|
|
|
|
|
Anyone know a good free easy to use tool to created and edit pdf files ???
Thanks
|
|
|
|
|
There are lots of Good and Free Libraries for PDF files. I do not know any easy ones though!
I would suggest that you google for c# free pdf libraries and read their documentation and select the one that you understand the most.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
This is one of the method but i did in vb.net
here is the link to change the vb code to c code
http://www.google.com.bh/search?hl=en&source=hp&q=code+converter+vb+to+c&btnG=Google+Search&meta=&aq=2&oq=code+convert[^]
public void CrearPDF(DataSet ds, string nombrearchivopdf)
{
StrongTypedReport cr = new StrongTypedReport();
cr.SetDataSource(ds);
Stream input = cr.ExportToStream(
CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
FileStream output = new FileStream(nombrearchivopdf,
FileMode.Create);
const int size = 4096;
byte[] bytes = new byte[4096];
int numBytes;
while((numBytes = input.Read(bytes, 0, size)) > 0)
output.Write(bytes, 0, numBytes);
output.Close();
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
That is excellent. I can do the same with some of the software that I have.
But it ain't free is it? This was one of the requirements of the OP.
The link to conversion the software search was a good idea, I don't need it personally, but others might find it useful.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hello everybody,
in a partial task of my project I read from file and displayed a non-GDI picture (10-bit linear-RGB DPX file). In a former approach, this took around 580 ms for a single picture. Hoping to increase the performance, I split the reading of the file and the display of the picture into 2 separate functions - which has been resulting in an immense loss of performance (7500 ms per picture now). I can't understand why and how to avoid that? Maybe someone around here could recognize my blind spot and help me out?
In the newer approach, the file reading is performed by a background worker while the first picture displays. The BGW puts header and image data (as array of UInt) into a special 'dpx' class, a particular number of which are stored in a 'frames' class. This part still seems to work fine. The dpx class reads the file like
Public Function read_Image() As Array
fsh = New FileStream(Me.FileToRead.FullName, FileMode.Open)
brh = New BinaryReader(fsh)
'Set the position to the proper position of the files stream.
fsh.Position = Me.DPXOffset
ReDim DPXPixelArray(((Me.FileToRead.Length - fsh.Position) / 4) - 1)
For i As UInteger = 0 To Me.DPXPixelArray.GetUpperBound(0)
Me.DPXPixelArray(i) = SwapDWORD(brh.ReadUInt32)
Next
fsh.Close()
brh = Nothing
Return DPXPixelArray
End Function
Before, all of this was part of the displaying process: read the file, swap the bytes properly, then get RGB out of the 10-bit-data into a RGB byte array (i.e. convert) and display the bitmap. Now that the DPXPixelArray holds the raw data stored in the class in order to do what ever with it, I expected to have much lesser than 580 ms for the display process, since the class only (?) has to convert the array of UInt to a bitmap. This is done with
Public Sub DisplayImage()
If gch.IsAllocated Then gch.Free()
Dim arrayImage() As Byte = dpx.RGBArrayFromRawArray(dpx.DPXPixelArray)
gch = GCHandle.Alloc(arrayImage, GCHandleType.Pinned)
Dim pBuf As IntPtr = gch.AddrOfPinnedObject
Dim Width As Integer = dpx.DPXWidth
Dim Height As Integer = dpx.DPXHeight
Dim stride As Integer = Width * 3
PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
PictureBox1.Image = New Bitmap(Width, Height, stride, Imaging.PixelFormat.Format24bppRgb, pBuf)
End Sub
Public Function RGBArrayFromRawArray(ByVal RawArray) As Array
Dim j As Integer
Dim RGBArray(CInt(RawArray.Length * 3) - 1) As Byte
For i = 0 To (RawArray.Length - 1)
j = i * 3
Dim buff As UInteger = RawArray(i)
' bit-shifting operation
RGBArray(j) = (buff And &HFFC) >> 4 ' Blue
RGBArray(j + 1) = (buff And &H3FFFFC) >> 14 ' Green
RGBArray(j + 2) = (buff And &HFFFFFFFC) >> 24 ' Red
Next i
Return RGBArray
End Function
Measuring the elapsed time, the RGBArrayFromRawArray function alone takes more than 7 seconds now! What's wrong here? The function seems to be almost identical to what I had before...
Any hints and advice extremely welcome!
Thank
Mick
|
|
|
|
|
I was able to solve the problem myself with the change of just a few lines of code, in particular taking care of proper VB syntax:
Public Function RGBArrayFromRawArray(ByVal RawArray() As UInteger) As Array '<----- change
Dim j As Integer
Dim RGBArray(CInt(RawArray.Length * 3) - 1) As Byte
For i As Integer = 0 To (RawArray.Length - 1)
j = i * 3
Dim buff As UInteger = RawArray(i) '<----- change
' bit-shifting operation
RGBArray(j) = (buff And &HFFC) >> 4 ' Blue
RGBArray(j + 1) = (buff And &H3FFFFC) >> 14 ' Green
RGBArray(j + 2) = (buff And &HFFFFFFFC) >> 24 ' Red
Next i
Return RGBArray
End Function
Each picture displays from the DPXPixelArray within 65 ms now!
Quite a good lesson for me how taking a nap and then remember proper syntax can make a huge difference...
|
|
|
|
|
I need help learning how to use activelock from could someone help me?
please email me at timnboys@gmail.com or email me on this site, to help me with activelock, I am using visual basic 2008 express edition
|
|
|
|
|
If you go to their home page (the address you give in your post), you will see that there is a navigation link to 'Forum'. That is where you should ask your question. They know more about their product than anyone here is likely to.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
you do realize you've just sent away a new CP customer?
Chris wants you to be much nicer. We're in the middle of a crisis, we can't afford to loose business like that.
|
|
|
|
|
Sorry!
Won't do it again.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Actually, it was the correct thing to do. He was being sarcastic.
It's amazing how many people out there think that we know everything about the thousands of libraries out there. Apparently, the manufacturer of a library is the last people you ask when you have questions about it.
|
|
|
|