|
i don't know if this may help but it's something to look at
textbox.font = new font ( fontname, fontsize, fontstyle)
where
textbox = is the textbox, label, or any object with a font property
fontname = the name of the font as a string
fontsize = the size of the font in points (single value only)
fontstyle = options like bold, italic, and underline, but the options have to be fontstyle objects (no strings)
what this does is makes anew font object and sets the textbox (or whatever you use) font property to the new font.
most of this stuff can be stored in an ASCII file (just make sure to convert your fontsize value from string to single)
hopes this helps
Gengeneer (noun)- a person who wants to be an engineer, but is often too stupid to complete the training required. Often thinks he/she is smarter than everyone else
|
|
|
|
|
Hello,
vs 2005
I have the paths of documents in a datagridview. The documents can be different types, e.g. excel, word, paint, photoshop. However, most will be word documents
e.g. Path - c:\documents\job.doc
c:\documents\task.xsl
c:\documents\schedule.jpg
All these are in a database and are loaded into a datagridview.
The user will want to print all the documents that are contained in the grid.
So they will click a button and all the documents should print out.
Can anyone time me the best way to achieve this.
Many thanks for your time,
Steve
|
|
|
|
|
One way to do it is to loop through the datagridview and then call the System.Diagnostics.Process
Something like:
dim p as System.Diagnostics.Process
p.StartInfo.Verb = "print"
p.StartInfo.FileName = "putthefilenamehere"
p.StartInfo.CreateNoWindow = true
p.StartInfo.UseShellExecute = true
p.Start()
'might need to wait a few seconds for the print spooling
System.Threading.Thread.Sleep(5000)
p.Close()
Hope that helps.
Ben
|
|
|
|
|
Hello Ben,
Thanks for the code, it worked great.
Just one thing, about the system.threading. Is this the main UI thread this is sleeping?
What would happen if you don't set the sleep, before the close?
Many thanks,
Steve
|
|
|
|
|
Hey Steve,
It is the main UI thread that is sleeping. If you don't set the sleep and close the process before the print job has spooled then the print job will be canceled.
If you want the app to still be responsive you should do something like thing:
For i As Integer = 1 To 10
System.Threading.Thread.Sleep(500)
Application.DoEvents()
Next i
So you only sleep for 1/2 a second and then process any windows events.
Hope that helps.
Ben
|
|
|
|
|
Hi,
I have a datagridview (.NET 2.0)
In one column I had placed combobox to select values.
I would like to add the images with this values in the combobox
How can I do this
Thanks in advance
Parag
|
|
|
|
|
Is there any way to use DDE in vb.net because I want to communicate with a application called Fiche Finder? Does anyone have any samples using DDE? Any sugestions will help.
jds1207
|
|
|
|
|
Hello !!
I installed Windows 2oo3 SP2 yesterday. Everything works just fine but one thing so far.
I develop asp pages that call COM objects in VB6 but since I installed SP2 I'm unable to launch the COM object from VB and set breakpoints and such... IIS sends the following error '80030019' on the CreateObject line which I don't understand since it's related to seeking records...
(Server.CreateObject gives 'ASP 0177 : 80030019')
Any idea ??!! Am I good to uninstall SP2 ?
Thanks !
|
|
|
|
|
does iuser_/iwam_ have read/execute access to where the dlls are?
|
|
|
|
|
It didn't... I added it but the problem remains the same
I granted iuser_ and iwam_ access from the top of the drive down to the folder where the dlls and sources are.
Any other idea ?
|
|
|
|
|
Still having the problem but
I found out in my Security Log the Machine Debug Manager couldn't be started because the Network Service account didn't have the rights to. I added the proper rights through the dcomcnfg. I don't have the message anymore but my problem remains.
Microsoft Machine Debug Manager configuration
|
|
|
|
|
1) does the system account have access to the dlls
2) the account your logging into when you debug...is that an admin account or...if not, then does it have access to the area of the dlls?
|
|
|
|
|
1) Which account are you referring to ?
2) yes I'm domain and local admin so there should not be a problem there
|
|
|
|
|
Hi All,
Iam writting a console application where user writes in command prompt the following:
ApplicationName.exe "PathOfFile" "PrinterName"
to print a ceratin file.
My issue is that if i chosed a printer that is not set as default on my pc it is not printing.
In other words, i need a command that sets a certain printer on the network to be as my default printer in order to let my application prints the file.
i dont want the user to manully sets the targeted printer as default. I want a script/batch that sets that printer as default and then prints from my application.
Any Ideassss.....
|
|
|
|
|
samerh wrote: dont want the user to manully sets the targeted printer as default. I want a script/batch that sets that printer as default and then prints from my application.
So, you want the user to set the default printer back to what it was after your code runs?
samerh wrote: Iam writting a console application where user writes in command prompt the following:
ApplicationName.exe "PathOfFile" "PrinterName"
Why is the user specifying a printer name if your code doesn't use it? Your code has to be written to use this and not depend on the default printer. There is no single command that's going to fix this problem for you.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi,
we have written code to start the 'HH.exe' process with argument passed. And the process is started.
After starting this we are calling MainWindowHandle.ToInt64 of the above process. But am getting 'Process has Exited, so the requested information is not available'. When i check in task manager, the 'HH.exe' is running
Can any one tell me what could be the cause the above issue and solution for it
Thanks
R.Vasanth
|
|
|
|
|
If this "HH.EXE" is a DOS application, there will be no MainWindowHandle.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi,
I switched over from VB6 to VB.NET.
In VB6 when we wanted to temprorily disable error handling, we used "Break on all Errors".
How do we disable error handling in VB.NET?
I've Got stuck in a procedure that has a lot of code between the try...catch block and many nested try.. catch blocks too. I want to know which part of the code is generating errors.
Please help.
Thanks,
|
|
|
|
|
Do the errors not throw exceptions? If they do have you tried checking the stack trace for the error? That should at least point you in the right direction.
|
|
|
|
|
There is no equivilent in VB.NET.
Set breakpoints in your catch statements and look at the stack trace,
or set them at the beginning of your Try blocks and step through the code line by line,
or comment out the Try/Catch statements,
or instrument your code and log critical information you need to trace back the errors.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
You said you want to know what part of the code is generating errors. It sounds to me like you actually want the errors to happen as though there is no try...catch block. You can accomplish this by going to Debug > Exceptions and then checking the checkbox for 'common language runtime exceptions' under the 'thrown' column. This should cause the program to break when an error occurs even if it's in the try...catch block.
|
|
|
|
|
Hello,
I am working in Visual Studio.NET 2003. I just want to ask if there is any way I could tell System.Diagnosis.Process to start a new process/window on my desired location. Actually I am working in a Multiple Monitor environment and want System.Diagnosis.Process to open on the second monitor (by setting up location)
<br />
Dim p As System.Diagnostics.Process<br />
Dim pinfo As New System.Diagnostics.ProcessStartInfo<br />
pinfo.Arguments = "C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen c:\Picture 001.jpg"<br />
pinfo.FileName = "C:\windows\system32\rundll32.exe"<br />
Process.Start(pinfo)<br />
Above is a code which i am using to open up Windows Picture and Fax viewer(of which i want to set the location of)
Thanks,
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
You can't tell it which monitor to start on. An application will always show up on the primary monitor, then you move it to the monitor you want. The exception to this is if the application was run before and it saved it's last position, before it closed, so that it can recreate it's window in that same position the next time it runs.
So, you're only choice is to launch the application, get it's window handle, by calling the Win32 API function FindWindow, then sending the appropriate window messages to that handle to move it to the desktop coordinates on the next monitor.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Hi,
i want to copy a line from any text file and paste it to another text file.
let me know how to do that?
regards
pankaj kumar
|
|
|
|
|
Which bit are you stuck on ? You can't insert text into a file, you need to read it, insert it in memory, and overwrite the existing file.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|