|
Oscar Dog wrote:
Is there a way to write to a cd from c#?
You mean .NET? C# is just a language that targets the CLR. And while there probably is a way (did you actually try googling for one?), this would be insane. .NET languages are upper-level languages that typically require wrapper libraries, like the System.Windows.Forms assembly contains mostly wrappers of Windows Common Controls. Then you're bound to the constraints of the library which will probably be no better than your CDR software.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hey I am a physicist, not a programmer. I realise .NET is a lng way removed from the hardware I want to control. The only reason for considering c# is that I am a lot more comfortable with it than C++.
Yeah, I googled for one and maybe my best bet is the Nero SDK.
Thanks, I think?
|
|
|
|
|
Hiya I have made a Service program by following one of the tutorials in Code Project. It shows you how to create a service from scratch and make an installer for the service. I have ran the installer but the service does not show in the services.
I have also tried to install the service also by using install util -i myapp.exe.
I have re-read and checked that I have done everything the document says and I have.
Does anyone know y my service will not appear??
|
|
|
|
|
I've noticed a strange problem with the services MMC and that is that if you install or uninstall a service from a command prompt it doesn't update in the Services MMC.
I wonder if the problem is as simple as restarting the Services MMC?
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
I have 200 jpgs that originally were a single jpg. I need to tile these back (10x20) and save it out to a single jpg. Is it possible move blocks of memory around into the correct positions to reassemble the original jpg (after striping out the jpg header)?
(Basically, I’m looking for a simple (i.e. lazy) way out without having to read through the jpeg specs.)
Thanks in advance,
Kevin
|
|
|
|
|
GDI+ will read and write jpegs, so all you need to do is create an image big enough, load the smaller ones, drawn them onto it, and save it.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
|
I am new C# programmer, transferring from Mainframe COBOL. I am trying to learn the in's and out's of C# for a major project at work and am trying to figure out how to call another project's form depending on a user selection. I can get the user selection to work, but I cannot figure out how to get the new form to start. Both projects are in the same solution, if that helps. Can anyone help me please?
Thanks in advance!
Chuck Schmidt
|
|
|
|
|
Option 1:
Use the System::Diagnostics::Process class and run the .exe of the form.
Option 2:
Call ShowDialog() on the form.
|
|
|
|
|
That won't work without remoting. That executes the entry point of the application which usually calls Application.Run , but a calling app has no control over that without using remoting.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Don't think of projects - think of assemblies. Just like you create a form from the System.Windows.Forms, you do from another projects. One cool trick in VS.NET is to add a project reference as a dependency to the project that needs it. Just right-click on the project that needs a class from the other project, click Add Reference, then click the Projects tab. Double-click the project to add it and click OK to close the dialog. The great thing about this is that when you do a Debug, Release, or custom build configuration, the appropriate assembly reference is used.
To use a form in another assembly, just instantiate the class (using the fully-qualified type name (namespace + class), or add using namespace; at the top of your source file. Instantiate the form like any other.
Now, if these two projects run side-by-side (both executing individually at the same time), you'll need to use remoting. Doing what the other person mentioned won't work - you can only execute a program's entry point that way.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
That is sort of what I ended up doing. I started the project over and created the other forms I needed in the same project, instead of separate projects for each form, and then instantiated an instance of the form with the ShowDialog method to display it.
Thanks for the replies>
Chuck Schmidt
|
|
|
|
|
I'm having a problem getting my program to restore from the system tray. Minimizing to it is no problem.
private void FormMain_SizeChanged(object sender, System.EventArgs e)
{
if ( this.WindowState == FormWindowState.Minimized )
{
this.ShowInTaskbar = false;
this.notifyIcon.Visible = true;
}
}
And restoring it:
private void notifyIcon_DoubleClick(object sender, System.EventArgs e)
{
this.ShowInTaskbar = true;
this.WindowState = FormWindowState.Normal;
notifyIcon.Visible = false;
}
But I'm getting this error before the program is shown in the taskbar:
An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in system.windows.forms.dll
Additional information: Error creating window handle.
Any ideas?
|
|
|
|
|
Sorry, forgot to sign in.
|
|
|
|
|
Is it possible to have the tab key work inside of a property grid? So that when a user is editing properties, they can just hit tab to go through the list of properties?
Or is there some other key that does this with a property grid?
|
|
|
|
|
Dear all ,
if anybody know how to deal with USB port by C# ,could you send me the function that i have to use , i feel that it is not as easy as COM (RS232) programming so can you help me with it
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
I found this article link[^] really helpful when I was trying to access a Cypress USB device through C#. Please note that it uses managed and unmanaged C++ to do the communications (not exactly what you want I imagine). If anyone else has any other information on how to communicate directly using C# I would also be interested.
Cass
|
|
|
|
|
Thank you for that information . i have found another help full document about usb you can find it in the following web site : www.usb.org
Mhmoud Rawas
------------
Software Eng.
|
|
|
|
|
I have an application written in C#... nothing really special about it but for some odd reason it loses all focus and becomes non-responsive after I tab onto another application. In the windows ALT-TAB list I see a WindowsFormsParkingWindow...
What is this and why is my app dying? No one on the web seems to know why this is happening.
modified 30-Aug-22 21:01pm.
|
|
|
|
|
Here is some more info on this issue:
If you have time, please can you have a quick look into this:
We are developing a windows forms application using VS.NET 2003 and are having endless hassles.
Our current issue is the application seems to lose focus and will no longer receive focus or fire click events.
We can invoke this behaviour by ALT-TABBING from our application and then returning to it.
We need to forceably shut it down and reopen it.
When this happens, we can ALT-TAB and then there is non-visual window called “WindowsFormsParkingWindow“ that seems to come from the framework.
This link mentions it, but is of no help.
http://www.csharp-station.com/ShowPost.aspx?PostID=2564
Any ideas?
A very similar issue we have is that the same application won’t close when the top-right window close button is pressed or when ALT-F4 is pressed.
Although we have had the “WindowsFormsParkingWindow” before, the app didn’t respond to ALT-F4 beforehand too.
We are positive that we are not overriding onClose events or trapping these keypresses.
Microsoft doesn’t have KB on this currently.
Cheers,
Simon
sig :: "Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
article :: animation mechanics in SVG blog:: brokenkeyboards
|
|
|
|
|
Hi,
Let's say that I have a TextBox or a RichTextBox on my windows form. I need to programmatically scroll it up or down, but I can't seem to find a way how to do it, the only method I have seen is scroll to caret. Is it possible at all, by a call to some method or by forwarding events from keyboard/mousewheel to the respective control?
Thanks in advance,
Rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
You'll have to P/Invoke SendMessage and create a couple consts (or a enum) with the values for EM_GETSCROLLPOS (1245) and EM_SETSCROLLPOS (1246). You'll also need to define a POINT struct as it is in Windows. Then, call SendMessage with the handle of the RichTextBox , which you can get from the Handle property inherited by Control :
[DllImport("user32.dll")]
private void SendMessage(IntPtr hWnd, int msg, int wParam, ref POINT lParam);
private struct POINT
{
public long x;
public long y;
}
private const int EM_GETSCROLLPOS = 1245;
private const int EM_SETSCROLLPOS = 1246;
POINT p = new POINT();
p.x = x-coordinate;
p.y = y-coordinate;
SendMessage(myRichTextBox.Handle, EM_SETSCROLLPOS, 0, ref p); You can roughly calculate using the font properties where you want to scroll to, or use EM_GETSCROLLPOS to get the current position, then add or subtract an x and / or y value and call EM_SETSCROLLPOS to scroll the text down or up, respectively.
Read more about EM_SETSCROLLPOS in the MSDN library for more information.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hello Heath,
Thank you very much for your detailed response! One of my friends already suggested a similar method (using a different message constant) to me which scrolls by one line of text at a time, but I will surely test your method as well.
This is the code my friend suggested, if anyone is interested:
<br />
private const uint WM_HSCROLL = 0x0114;<br />
private const uint WM_VSCROLL = 0x0115;<br />
private const uint SB_LINEUP = 0;<br />
private const uint SB_LINELEFT = 0;<br />
private const uint SB_LINEDOWN = 1;<br />
private const uint SB_LINERIGHT = 1;<br />
<br />
SendMessage(this.rTB1.Handle, WM_VSCROLL, SB_LINEUP, 0);<br />
SendMessage(this.rTB1.Handle, WM_VSCROLL, SB_LINEDOWN, 0);<br />
SendMessage(this.rTB1.Handle, WM_HSCROLL, SB_LINELEFT, 0);<br />
SendMessage(this.rTB1.Handle, WM_HSCROLL, SB_LINERIGHT, 0);<br />
<br />
<br />
[DllImport("User32")]<br />
private static extern uint SendMessage(IntPtr hWnd, uint Msg, uint wParam, uint lParam);<br />
Thanks again for your help,
Rado
Radoslav Bielik
http://www.neomyz.com/poll [^] - Get your own web poll
|
|
|
|
|
WOW CodeProject is so cool
I was just about to ask this question only to come and find it answered =)
CP RULEZ!!
|
|
|
|
|
Is there anyway to scroll the TextBox when you are not focused on the application?
|
|
|
|