|
What I did one time when I was trying to do the same thing was put a panel control where you want the form to go. The panel control, if I remember correctly, is able to "host" a form so you just create an instance of the form and add it to the panels controls.
|
|
|
|
|
I have already tried that but when i Run:
myPanel.Controls.Add(myForm);
...I get an error message something like this:
"You can not add a top-level control to a control".
(I should have written that in my first post.)
So, do you know if it still is possible any other way?
/Ricky
|
|
|
|
|
What I did was this, and it works for me:
In the constructor code for the form add:
this.TopLevel = false;
In your main form use this:
frmAddNew add = new frmAddNew( );
add.Parent = panelWorkArea;
panelWorkArea.Controls.Add( add );
add.Visible = true;
Let me know if that works for you.
|
|
|
|
|
Thank you!
That works just fine. Next, I will try to get rid of the form border. I quickly found the ways to remove the system, minimize, maximize and close buttons. I docked the form to the panel so when the panel (inside it's form) resizes, the subform follows. Perfect... but, the user still sees the window border and caption and can manually resize the form. I suppose it's very easily removed but I simply have not found the command yet. My knowledge in Windows Forms seems quite rudamentary yet.
/Ricky
|
|
|
|
|
No problem, glad it helped.
For the border, just set the border style to none and the title and resize-ability will go away.
Michael
|
|
|
|
|
You can somehow set ID numbers to the buttons on your toolbar and then catch every event from this button or something like this
private void button1_click (la la la ..)
{
ContractListForm frm1 = new ContractListForm();
this.Hide();
frm1.Show();
}
"I have not failed.
I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
|
|
|
|
|
One other approach would be to derive all your *ListForms from UserControl instead of Form. You can still use the forms designer with a UserControl. I don't think you will lose much, if any, functionality that you need, but you may have more flexibility for reusing the *ListForms and for hosting them in any type of control or form.
I've also been wondering about the best approach for something like this, so I would like to pose a general question to the group. To create the type of "Outlook" UI Ricky asks about, is it better to use Forms or Controls (such as UserControl)?
Which has more flexibility?
Which is easier for RAD UI development?
Which has more support and is more widely used?
Which is easier for integrating menus, toolbars, etc.?
In my case, I have two choices. I could use either a tabbed MDI host (like in VS.NET) with multiple forms, or I could use various host controls (including tab controls, etc.) to display my own UserControl-derived objects.
Any comments are appreciated.
Dave
|
|
|
|
|
Hi ,
I had created a toolbar and need to deploy it over the internet . I created a cab file with an ini file in it . This cab file was referenced from a html page through the OBJECT tag . The cab file was aldo digitally signed with a certificate created with the help of the tools available in .net . But when that page is referenced the installation does not take place .
Please help . Where could i have gone wrong . The OSD file everything has been written with the help of instructions from the MSDN documentation .
And how do i run a dos command from an ini file . I tried usig the run statement but it didnt work . Please tell me how to do it . If run is the command then please send the syntax for the run statement .
Srikar Y
NITK Surathkal
|
|
|
|
|
Hi All,
I develop plugins for graphic apps. So far I used Visual Studio 6.0 also because it was the tool of choice for the SDKs of such graphic apps.
Now some vendors have moved their SDKs to .NET
So far I only heard bad rumors about the "opennes" of the code that the .NET IDE produces and on top of that I don't care to be net-ready or anything of the kind, I only need to process pixels. At risk of sounding naive and ignorant my questions are:
Is there an independent and reliable source where I can read more about pros and cons of using .NET? When is really necessary to use it and when is only trendy or redundant?
Is there a way (or secret recipe) to turn .NET into Visual Studio 6.0 or something close to it?
Thank you.
|
|
|
|
|
Yeah, by unistalling .NET and installing visual studio 6.
Seriously though, .net is neither trendy or redundant. Depending on the language you are coming from you'll be amazed at how much more you can accomplish in .net compared to your previous language. Things that used to be difficult or require 3rd party tools are now easy and built-in to the language.
.net 2003 comes with an obfuscator(?) or you can get a tool for .net 2002 that will do it for you.
|
|
|
|
|
Does anyone know how I can get (and eventually set) the properties of a file.
I have some pictures take with a digital camera. In all the pictures properties (attributes?) are set for lot o things. E.g. Widht, Height, Bit Depth, Flash Mode, Focal Length, etc...
I guess that the attributes are dynamic. But how can I read them using the Framework?
I have not been able to find the attributes using a FileInfo-object.
I have seen someone doing this on the net using a COM-object with prog-id "DSOLEFILE.PropertyReader".
Do I have to use this in stead? And in that case where can I find it?
Thanks in advance,
Mattias
|
|
|
|
|
Here is a class I have used before:
Imports System.IO<br />
Public Class ProjectFile<br />
Private _path As String<br />
Private fi As FileInfo<br />
Private _Name As String<br />
Private _DirectoryName As String<br />
Private _Extension As String<br />
Private _Attributes As String<br />
Private _CreationTime As Date<br />
Private _LastAccessTime As Date<br />
Private _LastWriteTime As Date<br />
Private _Length As Long<br />
Private _FullName As String<br />
Public Sub New(ByVal path As String)<br />
_path = path<br />
fi = New FileInfo(_path)<br />
_Name = fi.Name<br />
_DirectoryName = fi.DirectoryName<br />
_Extension = fi.Extension<br />
_Attributes = fi.Attributes.ToString()<br />
_CreationTime = fi.CreationTime<br />
_LastAccessTime = fi.LastAccessTime<br />
_LastWriteTime = fi.LastWriteTime<br />
_Length = fi.Length<br />
_FullName = fi.FullName<br />
End Sub<br />
Public ReadOnly Property FullName() As String<br />
Get<br />
Return _FullName<br />
End Get<br />
End Property<br />
Public ReadOnly Property Length() As Long<br />
Get<br />
Return _Length<br />
End Get<br />
End Property<br />
Public ReadOnly Property Path() As String<br />
Get<br />
Return _path<br />
End Get<br />
End Property<br />
Public ReadOnly Property Name() As String<br />
Get<br />
Return _Name<br />
End Get<br />
End Property<br />
Public ReadOnly Property DirectoryName() As String<br />
Get<br />
Return _DirectoryName<br />
End Get<br />
End Property<br />
Public ReadOnly Property Extension() As String<br />
Get<br />
Return _Extension.ToLower<br />
End Get<br />
End Property<br />
Public ReadOnly Property Attributes() As String<br />
Get<br />
Return _Attributes<br />
End Get<br />
End Property<br />
Public ReadOnly Property CreationTime() As Date<br />
Get<br />
Return _CreationTime<br />
End Get<br />
End Property<br />
Public ReadOnly Property LastAccessTime() As Date<br />
Get<br />
Return _LastAccessTime<br />
End Get<br />
End Property<br />
Public ReadOnly Property LastWriteTime() As Date<br />
Get<br />
Return _LastWriteTime<br />
End Get<br />
End Property<br />
End Class
Also check out this link: LookCool, an image browser application (JPG only) and Photo Properties By Jeffrey S. Gangel
Jim
|
|
|
|
|
Thanks a lot...
That helpt me out completely.
/Mattias
|
|
|
|
|
how can I make a shortcut for button in .net cf (smart device application for windows ce .net)
Ignatov
|
|
|
|
|
Anyone know of a Diff component (like WinDiff, WinMerge, Araxis Merge, et al) which i can use to compare files, which preferably ALSO has support for reading from streams, not just from disk files?
Thanks in advance,
- Eidolon.
|
|
|
|
|
There are at least two different managed diff implementations posted as articles here on codeproject. Do a little searching.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Hi @ All!
I was wondering if anyone knows about a class in the .net framework to work with shortcut (.lnk) files.
Should be a class to get the path of the exe, the image etc...
I searched the .net help for hours, but i couldn't find anything. Now i might write a class myself, but i thought i'll ask if there already is one first...
thx!
|
|
|
|
|
Hi everybody.
Is there a way to use .NET Remoting with Visual C++ .Net?
In positive case, how to build the interfaces like they're
built in C#?
Thanks,
Moises.
|
|
|
|
|
With VS 2002 we could send a GET request to a web service and it would work. After upgrading to VS 2003 it doesn't work and doesn't seem to be available. Anyone know what happened?
ed
Regulation is the substitution of error for chance.
|
|
|
|
|
Here are some codes:
ICodeCompiler comp = (new CSharpCodeProvider().CreateCompiler());
CompilerParameters cp = new CompilerParameters();
cp.ReferencedAssemblies.Add("system.dll");
cp.ReferencedAssemblies.Add("system.data.dll");
cp.ReferencedAssemblies.Add("system.xml.dll");
cp.GenerateExecutable = false;
cp.GenerateInMemory = true;
StringBuilder code = new StringBuilder();
code.Append("using System; \n");
code.Append("using System.Data; \n");
code.Append("using System.Data.SqlClient; \n");
code.Append("using System.Data.OleDb; \n");
code.Append("using System.Xml; \n");
code.Append("namespace ADOGuy { \n");
code.Append(" public class _Evaluator { \n");
//code.Append("public static double MAX(double x,double y) \n");
//code.Append("{ \n");
//code.Append("public double max=0;\n");
//code.Append("if (x>=y) \n");
//code.Append("max=x;\n");
//code.Append("else \n");
//code.Append("max=y; \n");
//code.Append("return max; \n");
//code.Append("} \n");
code.Append("} }");
CompilerResults cr = comp.CompileAssemblyFromSource(cp, code.ToString());
I define a namespace and a class in the code string, it's ok. but when i add a method in the code string(marked as note://) ,it can't work. Who can tell me what format required of the code string.Thanks.
|
|
|
|
|
jian-ping wrote:
//code.Append("public double max=0;\n");
err, you should have seen that in the compilerresults...
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
That's not the problem,i just want to know how i can define a method in that class.
i think it may do that.but i wonder how to do it.
|
|
|
|
|
All,
I'm writing a data acquisition and control application that communicates with data boards and a control system using TCP/IP. I can design the application to use 1000's, 100's or 10's of sockets. My question is should I treat sockets and a scarce resource and try to conserve their use or create as many as I need without any performance worries?
Thanks for any comments.
Jeff Monheiser
|
|
|
|
|
A socket basically maps into a kernel object. It uses system memory - paged pool, IIRC.
The only answer I can give is to measure and find out. If your application will be the only thing running on a 1GB+ machine, thousands is probably OK. If on a 64MB system, you'll probably have horrible swapping problems.
|
|
|
|
|
We have four web servers each hosting our web service. We use DNS round robin to load balance across these four servers. In order to use SSL we have a certificate called for example, www.loadbalanced.com which is installed on all four machines. Things work beautifully.
However,
We now have a new internal application that needs to consume the web service over SSL but requires access to specific web servers, i.e. using they internal hostname, Unfortunely the SSL connection no longer works, I'm assuming this is because the hostname does not match the SSL certificate name. Can this be programmatically overriden? Just like clicking the security warning dialog box that appears when browsing a secure site using IE with a different hostname.
Many thanks in advance.
ps Alternative ways of depoloying the application to achieve the same affect also welcomed
|
|
|
|