|
Just as a community note: a windows service is not available w/ VS standard edition -- you must go higher.
Thx
|
|
|
|
|
LOL... sorry, I forget about that often... You could get around that by writing a console app and then using something like FireDaemon (I think that is the name?) that allows you to run an application as a service in Windows.
~dnc
|
|
|
|
|
public static Bitmap FromResource( IntPtr hinstance, string bitmapName ) I see that many others have had trouble getting Bitmap.FromResource() to work for them, and I've found conflicting or wrong information as to how to acquire the handle. Some examples call out to unmanaged functions. I'd like to avoid that if possible.
I have a VS2005 assembly DLL to which I've added many bitmaps as embedded resources (via Project.Properties...Add Files...). I assume that much is OK. Is there an entirely "managed" way to get the handle of the assembly to pass to the hinstance argument of FromResource()? If not, what is the recommended process?
|
|
|
|
|
For instance...
using System.Diagnostics;
myBitmap = Bitmap.FromResource( Process.GetCurrentProcess( ).Handle, @"MyBitmapResourceName" ); This call fails, reporting that the "Parameter is not valid."
|
|
|
|
|
This approach appears [?] to get a legitimate handle. The value is usually just over 1,000 -- 1,008, 1,032, etc. I've checked MyResourceName over and over again for case. I've tried all uppercase (which doesn't match the resource name), and I've tried odd syntax that I've seen in other examples (which resort to native C++ to get a handle) such as prefixing MyResourceName with "#" or including the file extension (which in my experience with resource files should be an error)... but still, all I get is a "Parameter is not valid" error:
IntPtr hInstance = Process.GetCurrentProcess().Handle;
if ( (IntPtr)0 != hInstance )
myBitmap = Bitmap.FromResource( hInstance, "MyResourceName" );
Process.GetCurrentProcess().Handle is as close as I've come to succeding, in that the value is possibly a legitimate handle/IntPtr value. Does anybody know how to do this?
|
|
|
|
|
hi
i have some tab controls and in tab_2_enter event, i want to set focus on specifid toolStripTextBox and selectAll method, but in runTime, when i enter to tab_2, toolStripTextBox does not selected, how to solve my problem ?
thanks
|
|
|
|
|
you can use this code:
toolStripTextBox1.Focus();
toolStripTextBox1.SelectAll();
Good Luck.
Alireza Loghmani
|
|
|
|
|
Hi All,
I am quite new to C# programming and have been reading lots of documents and books trying to get a handle on how to work with it. I am using Visual Studio 2005. I am wondering what the best way is to make an application that has one main "page" and different "sub pages" within it. I guess the best way to describe it would be to say I would like it to function like a tab control but without the tabs. The user would click on certain buttons/icons and a different "sub page" would show up on the application window. Kind of like if you have ever used Outlook or Outlook Express. There are links on the left hand side, such as Inbox, or Calendar, and when you click on these links, the "sub page" on the right changes to display whatever it is you've selected (exactly what would happen if it was a tab control and the user clicked on the appropriate tab, but without the tabs and without the tab pages).
I would like to design the entire interface in the Form Designer, and in last sample projects that I have done I have used the tab control (Then I could click on individual tabs and design that page accordingly .. I don't want to have to create buttons and everything programatically). I'm looking for a way to be able to do this without the tab control. (ie, create multiple "sub pages" and make them visible or not in code depending on which button/icon has been clicked). I have searched and searched but I think my problem is I do not know what this is called so that is why I am getting no where. Any help pointing me in the correct direction would be appreciated!
TIA
-- modified at 15:52 Tuesday 15th May, 2007
|
|
|
|
|
Maybe you want to take a look at some 3rd party UI library. We do use DotNetBar [^].
Usually these libraries provide much richer functionality than just pure Windows Forms.
|
|
|
|
|
Hi,
Thank you for the reply. The problem is that I am just learning C# and am writing code for various sample projects just getting a feel for it, so I do not really want to spend the $200 on a 3rd party library just because I'm not really building anything that is enterprise. I was just looking for a way to do this using forms designers with maybe group boxes or panels or some other element that I just have not come across yet.
Thanks!
|
|
|
|
|
You can build your page class from any Control descendant; utilize any list<t> or Collection you want to manage your pages; anchor each page to a page region; and build a navigation system to negotiate the page population. You can do a simple job of it to see what you're getting into. Professional results and deep functionality will not be trivial.
|
|
|
|
|
Not to seem like a total 'tard and be all offensive, but I did say straight up that I am new to C# programming.. I didn't undersand a word of what you said. heh, the guy from Germany spoke better English...
|
|
|
|
|
Good afternoon, would like to know if it has some library that to convert a data base mdb for cdb and to have access the data of this cdb?
Thank,
Cleber Ramos
|
|
|
|
|
|
Hi, first thank for answering.
I am making a Desktop application that gets an archive mdb and converts for cdb. This cdb will be sending for PDA (Pocket PC) and had access there. Then would like to know as I can convert this archive of mdb for cdb using the C#?
Thank,
Cleber Ramos
|
|
|
|
|
Hi Did You Made that application to convert these files or not yet. Becoz i am also serching for this option. Please do reply as soon as possible i will be really thankful to you.
|
|
|
|
|
i am trying to split a jpg right down the center and the left fram splits ok but the right frame has the problem it is 2 time as big as it need to be and it has a huge black border to the right can somebody please help me here is my code
public void split(System.Drawing.Image oimage)
{
System.Drawing.Bitmap bmp = new Bitmap(oimage.Width/2, oimage.Height);
bmp.SetResolution(oimage.HorizontalResolution,oimage.VerticalResolution);
System.Drawing.Rectangle lrec = new System.Drawing.Rectangle(0, 0,oimage.Width/2,oimage.Height);
System.Drawing.Rectangle rrec = new System.Drawing.Rectangle(oimage.Width/2,0 ,oimage.Width/2, oimage.Height);
System.Drawing.Image[] frames = new Image[2];
frames[0] =(Image) bmp;
bmp = new Bitmap(oimage.Width, oimage.Height);
bmp.SetResolution(oimage.HorizontalResolution, oimage.VerticalResolution);
frames[1] =(Image) bmp;
System.Drawing.Graphics gr = System.Drawing.Graphics.FromImage(frames[0]);
gr.DrawImage(oimage, new Rectangle(0, 0,oimage.Width/2, oimage.Height),lrec, GraphicsUnit.Pixel);
frames[0].Save(@"c:\temp\frameLeft.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
gr = System.Drawing.Graphics.FromImage(frames[1]);
gr.DrawImage(oimage,new Rectangle(0, 0, oimage.Width/2, oimage.Height),rrec, GraphicsUnit.Pixel);
frames[1].Save(@"c:\temp\frameRight.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
}
Thanks,
Chad Aiena
|
|
|
|
|
cmarmr wrote: bmp = new Bitmap(oimage.Width, oimage.Height);
Well, it's the width of the original, because that's how you wrote it.
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 )
|
|
|
|
|
thanks, minor oversight
Thanks,
Chad Aiena
|
|
|
|
|
Hi,
i have a xml file that i get from a website,
and i need to save the xml to the disk, but i need to add a namespace to the xml.
Im using XmlTextReader To read from a stream,
and after that im using xmlDocument.Load.
i want to set a namespace to the xml that i got,
and dont know how.
thanx,
shay
|
|
|
|
|
I am currently using FileSystemWatcher to monitor one directory for new files.
Can i use it to monitor two directories?
How would that be coded? Because when an event occurs(like a new file), the Event handler is the same. Would i have to create another event handler that does the same thing?
|
|
|
|
|
You can have two FileSystemWatchers and one event associated with both of them
|
|
|
|
|
So i take it that Windows will handle event syncronization. Cause if a new file gets dropped in both directories at the same time, would one event handler still be able to handle?
|
|
|
|
|
It would.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi All,
I have to syncronise the system Date through c# code.
The scenerio is like whenever User sign In, I have to check the current system date,and compare with the date i have written in Registery, so that he can not use the appication beyond the trial period date.
The Problem is that the User can Manipulate his system date and can sign in n number of times.
If anyone have the code then Please help me out in my problem.
Thanx
Sandeep
|
|
|
|