|
Hey,
I am trying to emplement a notepad type form into my application and I seen to be haveing a formatting problem. If I open the same .txt file useing notepad and with my editor the formatting is different. Mainly the whitespace seems to be off eg...
(item:something price:25) in notepad
is displayed as
(item:something price:25) in my editor
I counted the whitespace between each item in my editor and it doesn't seem to be the same with each one so its not standardizeing the whitespace or anything. I don't know what is causeing the difference.
Here is the generated code for my textbox on the editor form (textField)
Me.textField.AcceptsReturn = True
Me.textField.AcceptsTab = True
Me.textField.AllowDrop = True
Me.textField.AutoSize = False
Me.textField.Dock = System.Windows.Forms.DockStyle.Fill
Me.textField.Font = New System.Drawing.Font("Bookman Old Style", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.textField.HideSelection = False
Me.textField.Location = New System.Drawing.Point(0, 0)
Me.textField.MaxLength = 0
Me.textField.Multiline = True
Me.textField.Name = "textField"
Me.textField.ScrollBars = System.Windows.Forms.ScrollBars.Both
Me.textField.Size = New System.Drawing.Size(560, 323)
Me.textField.TabIndex = 0
Me.textField.Text = ""
Me.textField.WordWrap = False
I am useing no wordwrap by default and have an option to turn it on but i have tried it with and without on both notepad and my editor and that doesn't seem to make a difference.
Its important that my editor save and display text unformatted as Notepad does.
Thanks in advance for any suggestions
Harley
EDIT:
It just hit me that the way i read the data into the textbox may make a difference here so if it counts for anything i use...
Dim name As String
Dim title As String
Dim text As String
Dim path As String
path = OpenFileDialog.FileName
Dim sr As StreamReader = New StreamReader(path)
text = sr.ReadToEnd()
name = OpenFileDialog.FileName
title = name
newChild(Me, name, title, text)
and of course i have a module for creating new MDI child forms with the textbox and I pass the value of text to that modules newChild sub wich then does a simple
textField.text = text 'Where textField is the textbox in my editor form
|
|
|
|
|
Use a System.IO.StreamWriter and specify filename and encoding. Maybe there's an encoding problem?
greetz
*Niels Penneman*
Software/Dev Site Personal Site
|
|
|
|
|
I'll give that a shot with ascii
thanks
UPDATE:
I figured it out and now I feal stupid.
Turns out it wasn't a formatting issue at all and my only problem was the diffence in fonts used in notepad and my editor.
Thanks for the help
2 U.S. coins equal 30 cents and one is NOT a nickle. Hmm..
|
|
|
|
|
acecase wrote:
2 U.S. coins equal 30 cents and one is NOT a nickle. Hmm..
True, one is not a Nickel, the OTHER ONE is
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
|
|
|
|
|
hi,
can anyone explain me that how can i print a formatted report in VB6.
Vivek
|
|
|
|
|
I am trying to use MSCOMM32.ocx to receive binary data.
MSDN provides two sample code for text data. (Q194922- INFO:Receiving Data
using teh MSComm Control's OnComm Event) (for Send / Receive each). I used
them as the basis and then did the following changes -
- changed input mode to binary in both
- To send binary data passed a Variant containing an array of bytes
- On the receive side inspects the "Input" property.
////////////////////////////////////////////////////
Dim data As String
For i = 0 To MSComm1.InputLen - 1
data = data + "0x" + CByte(MSComm1.Input(i)) + " "
Next i
////////////////////////////////////////////////////
However on the receive side i am facing the following problems -
- I am not sure how to get the number of bytes received. InputLen and
InBufferCount gives 0
- Input is empty.
- InBuff gives some 3 junk characters when i had passed (10,11,12,13,14) as
bytes.
Can some body help out on how to properly receive binary data? Any help is very much appreciated.
thank you
aby
|
|
|
|
|
I have an animated gif set to play once (not loop forever)
I can display an animated gif in a form using the following:
picturebox.Image = Image.FromFile("c:\directory\image.gif")
The image displays correctly but plays forever even though it is set to play only once.
Without going through all the heavy lifting of using the Image animation class and counting frames. Is there a way to stop the animation after one play?
Thanks, GregC
|
|
|
|
|
Hi,
i am having some question reagarding Datagrid
1) I want to get the Rowcount
2) Column Count
3) want to select entire row when i click on any cell and need to unselect if i click on another row.
4) i want to get activate some code on the double click event of Grid.but this is not geting activating when i double click on any cell.is there any specific event?
|
|
|
|
|
|
Fellow NETer's
Check out the two latest demos I posted up:
http://www.codeproject.com/useritems/tile.asp
http://www.codeproject.com/useritems/vbclock.asp
Is there anything else you would like to see, I am quite bored and tired of looking for jobs and never hearing back. At least this way I can stay sharp.
|
|
|
|
|
|
Hi,
Need help on vb.net app that simulates the reminder facility provided in Ms Outlook 2000. Interface accepts input similar to a todo task description along with date & time. User can Dismiss/Snooze with specific interval when the reminder window pops up.
# Will a windows service solve this problem Or stick to an app with separate thread to process various timer events?
# Reminders shld popup when app starts - again similar to MSOutlook.
Suggestions will be much appreciated.
|
|
|
|
|
I don't see why you would use a service. The reminders would be no problem, just let the service interact with the desktop. But you say "when app starts" do you mean IF you would use a service you would make it interact with a GUI program? I suggest you just write a normal app... That's the most easy way to solve this problem.
greetz
*Niels Penneman*
Software/Dev Site Personal Site
|
|
|
|
|
I must agree, simple app that can load when the user logs in, sits in the tray and spits out reminders.
Its not like you are making a service that always needs to be up like a web server or something
|
|
|
|
|
Has anyone got a way to convert the output from the MS Rich Text Box to HTML ?
I have looked at a solution from easybyte.com (rtf-2-html) but was wondering if there was anything else out there?
Thanks
|
|
|
|
|
|
|
Hi,
Can any explain that how can i disable CTRL+ALT+DEL or Task Manager in Windows98 using Visual Basic 6.
Thanx,
Vivek
|
|
|
|
|
Option Explicit
Private Declare Function SystemParametersInfo Lib "user32" _
Alias "SystemParametersInfoA" _
(ByVal uAction _
As Long, ByVal uParam As Long, _
ByVal lpvParam As Any, _
ByVal fuWinIni As Long) As Long
Private Const SPI_SETSCREENSAVERRUNNING = 97
Private Sub Test
Dim retval as Long
retval = SystemParametersInfo(SPI_SETSCREENSAVERRUNNING, _
Disabled, 0&, 0&)
End Sub
UB
You may stop this individual, but you can't stop us all... after all, we're all alike. +++Mentor+++
|
|
|
|
|
Hi, im trying to develop a Reporting Service application in VS.NET 2003, but bumps into this problem when i try to reference to a VB.NET project called PriceServerApp
The build error is:
Error while loading code module: ‘PriceServerApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’. Details: The assembly 'PriceServerApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' cannot be loaded because code permissions have not been defined for it.
My question is: How the heck can I setup Code Permission on that PriceServerApp project?
I tried using the .NET Configuration Tool to add PriceServerApp to the GAC, so i would be able to set Code Permissions from there, but no luck, since PriceServerApp has a reference to an old Interopp'ed DLL.
Not even worked when i maximized the trust-level in Code Access Security Policy..
Heeelp...
/Magnus Lindberg
|
|
|
|
|
Disable CAS by caspol -s off. It's worth a try
UB
You may stop this individual, but you can't stop us all... after all, we're all alike. +++Mentor+++
|
|
|
|
|
Thanks, for the tips. Unfortunally it didnt work. It still complains about the same code access permission. Is there some other place i might disable this from?
/Magnus
|
|
|
|
|
HI..
Anyone had working with DB conection to AS400 using VB.NET?. This is a really important question becouse i'm starting develop some project with that feature..
Thank
Johnny Lizardo.
|
|
|
|
|
But yes ofcourse.
There's no problems what I have seen. I'm working with an IBM DB2 database, with the ODBC driver "Client Access ODBC Driver"
Hope my reply gave you all the answers you wanted. herher
/Magnus
|
|
|
|
|
Hi
Thank for your fast reponse. Look, This is my first time to try this with AS400.. For now I want the simple code to connection to any database.
Otherthing, only I need is the Client Access ODBC Driver for connection?
Thank a lot.
Johnny Lizardo
|
|
|
|