|
Hi all, i want to create a control that does just like a panel into Visual Studio.
If i want to set a background image i go on open file dialog at the voice background image and load the image.
I know how create this property for my cotnrol but when i laod the image it doesn't is set in my resource project directory as Visual Studio does.
How can i do?
|
|
|
|
|
Is your problem runtime or design time related? In design time Visual Studio should handle it automatically if its a public property. In runtime you will have to store the bitmap yourself. You could either save the bitmap as a file (image.Save()) or serialize it like Visual Studio does it. For this have a look at the System.Runtime.Serialization namespace.
|
|
|
|
|
the problem is in design.
if i use the panel object and i load a bitmap it is placed in resource project embedded file.
How can i do the same for my object?
|
|
|
|
|
Should be working automatically. Here is a small sample:
public class MyControl : UserControl
{
private Image _image;
public Image Image
{
get { return _image; }
set { _image = value; }
}
}
Setting the Image property with the designer will automatically put the image into the resource of the form.
|
|
|
|
|
it donesn't set the image in the resource.... why?
|
|
|
|
|
I wrote a Ftp client that works great on a Win2K - UNIX Type: L8 (Serv-U FTP-Server v2.5i) box but not on a Linex or Unix box.
Here is the Reponse from the Unix Server [UNIX Type: L8 (FTP server Version wu-2.6.1(1))]:
-rw------- 1 visual visual 6035 Dec 1 14:29 .bash_history
-rw-r--r-- 1 visual visual 24 Sep 12 2003 .bash_logout
-rw-r--r-- 1 visual visual 230 Sep 12 2003 .bash_profile
-rw-r--r-- 1 visual visual 124 Sep 12 2003 .bashrc
-rw-r--r-- 1 visual visual 688 Sep 12 2003 .emacs
-rwx------ 1 visual visual 13822 Mar 3 2004 .ezmlmwebrc
-rw-r--r-- 1 visual visual 29 Sep 12 2003 .forward
-rw-r--r-- 1 visual visual 29 Sep 12 2003 .qmail
-rw-r--r-- 1 visual visual 80 Jun 18 2004 .qmail-default
-rw-r----- 1 visual mail 4605 May 4 08:41 passwd.cdb
and here is the list from the Win2K [UNIX Type: L8 (Serv-U FTP-Server v2.5i)]
drwxrwxrwx 1 user group 0 May 17 17:42 .
drwxrwxrwx 1 user group 0 May 17 17:42 ..
drwxrwxrwx 1 user group 0 Sep 29 2005 _hide
drwxrwxrwx 1 user group 0 Apr 21 09:47 bin
drwxrwxrwx 1 user group 0 Sep 29 2005 cgi-bin
drwxrwxrwx 1 user group 0 Sep 29 2005 CheckDomain
drwxrwxrwx 1 user group 0 Apr 21 09:47 Clients
-rwxrwxrwx 1 user group 10490 Apr 20 16:04 clients.htm
-rwxrwxrwx 1 user group 10596 Apr 20 16:04 clients2.htm
drwxrwxrwx 1 user group 0 Sep 29 2005 Config
-rwxrwxrwx 1 user group 4279 Jan 17 09:49 contact.htm
-rwxrwxrwx 1 user group 6562 Apr 20 16:04 contact_us.htm
drwxrwxrwx 1 user group 0 May 17 12:44 Downloads
drwxrwxrwx 1 user group 0 May 5 13:46 flash
-rwxrwxrwx 1 user group 8659 Apr 20 16:12 hosting.htm
drwxrwxrwx 1 user group 0 May 11 10:11 images
-rwxrwxrwx 1 user group 5848 Apr 20 16:04 index.htm
-rwxrwxrwx 1 user group 361 May 17 12:08 LaConcordeTester.htm
drwxrwxrwx 1 user group 0 May 9 10:56 laservice
-rwxrwxrwx 1 user group 56 Nov 28 18:29 layout.css
-rwxrwxrwx 1 user group 3028 Apr 20 16:04 map.htm
-rwxrwxrwx 1 user group 6834 Nov 28 18:29 portfolio.htm
-rwxrwxrwx 1 user group 4296 Nov 28 18:30 portfolio_flash.htm
-rwxrwxrwx 1 user group 4211 Nov 28 18:30 portfolio_print.htm
-rwxrwxrwx 1 user group 6034 Nov 28 18:30 portfolio_web.htm
drwxrwxrwx 1 user group 0 Apr 25 13:51 pvservice
-rwxrwxrwx 1 user group 8323 Apr 20 16:45 services.htm
-rwxrwxrwx 1 user group 928 May 8 15:32 test.htm
drwxrwxrwx 1 user group 0 Apr 5 12:31 VPNoverADSL
-rwxrwxrwx 1 user group 4433 Apr 24 16:50 web.config
drwxrwxrwx 1 user group 0 Mar 10 17:23 wedding
-rwxrwxrwx 1 user group 5718 Mar 13 09:16 wedding.htm
What is best practice to Parse the data?
Leon v Wyk
|
|
|
|
|
Hi!
I'm using C# as script to launch an IE windows using the Interop SHDocVw.dll's ShellWindowsClass.Navigate(...) function. Now I want the
1. newly launched window to be opened maximized.
and
2. If this window is minimized then restore it.
Is there any class in Interop SHDocVw.dll, through which I can achieve this?
Presently the opening behaviour is not certain,sometimes it opens as expected,but other times new IE window gets created but remains minmized.
Also in a normal C# program this is achievable using 'User32.dll''s ShowWindow(..,..) function, but when I try to use this in my script I get syntex error at [DllImport.....].
can someone help me.
thanks in advance.
regards.
KT.
|
|
|
|
|
AFAIK, IE remembers the window state it was when it was shutdown. If you know the window handle, you can still maximize it by calling ShowWindow[^] with the P/Invoke signature mentioned in the link.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks Senthil!
I can get the IE window handle using hwnd property of InternetExplorerClass.But my problem is that I am getting the syntex error on my C# Script due to this statement:
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
I'v already imported the namespace System.Runtime.InteropServices;
regards.
Kuldeep.
-- modified at 5:32 Friday 19th May, 2006
|
|
|
|
|
What exactly is the compiler error you're getting? And does C# script mean something other than normal .cs files compiled using the csc compiler?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Yes, This is a C# script executed by some Scripting Engine other than the csc compiler.
This is the error:
{Error} 32 Errors: Line: 4 - } expected Line: 45 - Syntax error, ']' expected Line: 45 - Invalid token ')' in class, struct, or interface member declaration Line: ...
....
.....
|
|
|
|
|
Hmm, looks like your scripting engine doesn't like attributes. How about moving the DllImport code to a separate dll and then referencing the DLL from within your script?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Yes,That is what we are thinking now.
build the c# assembly that uses User#2.dll's Showwindow() function.
then use this assembly in our script through reflection.
Thanks.
BTW, Can you suggest some forum where I can get more help on this topic(C# script).
Thanks and Regards.
KT.
|
|
|
|
|
Hi,
I want to print a file/document from my PC where printer is connected in netwrok. There may be any number of printers in n/w i need to send my files to specific printers. How to do it in C# please help me out.
Thanks.
|
|
|
|
|
If you are using PrintDocument, you can use :
this.printDocument1.PrinterSettings.PrinterName = "\\MYROUTER\PRINTER1";
|
|
|
|
|
Hi , I Need to create Form how Display on desktop and all program that will be with him . like ICQ.
(When I open My Form All Item In desktop will remove left)
thank you!!
and have a nice day
kobi
|
|
|
|
|
|
|
Hi,
What's really the difference between an EXE and a dll?
Please let me know the answer!
Thank you!
Deepa!
Be the Change you want to see!
|
|
|
|
|
Hi,
Basically an EXE is an out process server application and DLL is an in process server application. now out process server means an application which does not need help of other application to execute. That means you can directly run an exe but you will nedd an exe to run a dll. These dll's are loaded inside some worker process and thats why they are called in process servers.
Also you can call dll's as components and exe's as applications.
Anant Y. Kulkarni
|
|
|
|
|
Hi Anant,
Thank you very much!It was really helpful!
Deepa!
Be the Change you want to see!
|
|
|
|
|
Deepasubramanian wrote: Please let me know the answer!
That secret is exposed here[^]
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
fullname of .exe is Extensible Execute File
fullname of .dll is Dynamic Link Liberary
.exe use by End User like-Client
.Dll can not use by End User.
We can Run the .exe
but we can not Run the .Dll
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
How to add a row into data grid in WINDOW FORM Application
|
|
|
|
|
If you have only table in that grid, it is easy, use this:
DataTable dataTable = this.dataGrid1.DataSource as DataTable;
if(dataTable != null)
{
DataRow dataRow = dataTable.NewRow();
dataTable.Rows.Add(dataRow);
}
this.dataGrid1.DataSource = dataTable;
|
|
|
|