|
Its funny you say that, because I posted a question similar to that just a little while ago, here are a couple of solutions for you:
http://www.codeproject.com/script/comments/forums.asp?forumid=1649&select=491274&df=100&fr=51#xx490206xx
S. Rod gives you a great solution, I give a simple one.
Good luck, its titled form design quandries.
Good luck,
Ryan
|
|
|
|
|
Instead of using MDI, you could create all of your "forms" as user controls and just handle their loading/unloading on the same form
|
|
|
|
|
"
Instead of using MDI, you could create all of your "forms" as user controls and just handle their loading/unloading on the same form
"
Could you please send me a small example?
thanks
|
|
|
|
|
It's more easy to use a panel in form and you cant make him on run-time
like this . In the dinamic construction the bad point is that the RAM is more use that for static declaration , but the diference is very small .
in Click event of the window make the code
{
Panel p=new Panel();
//give Panel properties
this.Controls.Add(p);
}
|
|
|
|
|
I am trying save images from a website using the System.IO namespace. What classes should I be using?
Steve
McLenithan
Is Bert Evil?
|
|
|
|
|
System.Drawing.Image.Save(...)
|
|
|
|
|
Greetings. I have an VC++ 6.0 App, and i'm moving to .NET. But i've chosen VC#. My question is. Is it possible to call a VC# dll from the VC++ 6.0 App? If it is, how can i do it? Thank u.
|
|
|
|
|
Depending on the amount of unmanaged versus managed code you want to expose :
- expose C# classes as COM type libraries. More info here[^].
- use MC++ mix mode. More info here[^].
|
|
|
|
|
I am using remoting to share object. But after few minute I did get the any object if I close my remoting server and start it again it works fine. Any idea?
Sonork ID 100:25668
|
|
|
|
|
I have already tried it.
Sonork ID 100:25668
|
|
|
|
|
Form.AlwaysOnTop = true/false;
|
|
|
|
|
I don't see your point. Owned windows are not like modal windows. That is, controls in owner windows continue to respond to mouse events even if an owned window is active. In other words, owner window/owned windows are exactly behaving like palettes versus main windows. The only slight difference is the window caption which changes from highlighted to unhighlighted when you click on one window and then on another.
If you are having problems with that caption, just hide it by applying the appropriate window style to it (remove WS_CAPTION). How this is done is through Interop SetWindowLong. Just look at a post 2 days ago, where I have the C# code to do something similar.
Hiding the caption can also be combined to making a form behave like a tool window (WS_EX_TOOLWINDOW), ie like a floating toolbar. But this won't change much since, as I have already said, owner/owned forms are not even modal against each other.
|
|
|
|
|
1.I have a short message like this :
<model>
<item last="0" first="10" direction="forward">
....
... I want to display this code like Internet Explorer showed with full color.
2. I have a list box with 4 colunms. I want to embed combo box in first colunm and a combo box in the last colunm.
Show me the way !
Thank
|
|
|
|
|
try to post again. This time, make sure to use < and >
|
|
|
|
|
how can i draw! a text wich also "link" to mail or site ???
|
|
|
|
|
Use the link label object.
|
|
|
|
|
Hi,
i am not so long on c#. I want to get the input on the com1-Port by a Barcode-Scanner into my Text Field on my form. Can somebody help me??? thnx
Viedy
P.S.: Sorry, my English is not so good
|
|
|
|
|
Hi WiB,
thank you for your answer, but this is not really what I want. Is there a Com-Object or anything else to communicate with serial-Ports??? I haven´t found anything in my Toolbox.
|
|
|
|
|
|
You must to open a file using the name "COM1" in file name
Best Regards
Carlos Antollini.
Pi Five[^]Creator
Sonork ID 100.10529 cantollini
|
|
|
|
|
Hello
Any one have idea how to create or remove dsn
programatically in c#.Plz help..
Faisal Nadeem
Software Engineer
|
|
|
|
|
look for API SQLConfigDataSource in MSDN
or buy http://www.pardesifashions.com/Softomatix/OdbcNetTools.aspx
|
|
|
|
|
Hi All
I'm using a SaveFileDialog to get a filename from the user. I've create a list of filters, but at the point where I try to save the file I still have to create a very dirty switch over the filterindex. Does anybody now cleaner way to implement this?
thx in adv.
|
|
|
|
|
The cleanest way to do this is to use the ImageCodecInfo class, and some reflection on the ImageFormat class. The code isn't simple, but you won't need to update it if new formats are added. Just call ImageUtils.GetImageFormatForFile , pass in the selected file name, and the function will return the correct ImageFormat object.
using System;
using System.IO;
using System.Reflection;
using System.Drawing.Imaging;
public class ImageUtils
{
public static ImageFormat GetImageFormatForFile(string filename)
{
if (null == filename || 0 == filename.Length)
throw new ArgumentNullException("filename");
int index = filename.IndexOf('.');
string ext = (-1 == index) ? filename : filename.Substring(index + 1);
ext = "*." + ext;
ImageCodecInfo info = null;
ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();
for(int i=0; i<codecs.Length && null == info; i++)
{
string[] extensions = codecs[i].FilenameExtension.Split(';');
for(int j=0; j<extensions.Length && null == info; j++)
{
if (0 == string.Compare(extensions[j], ext, true))
info = codecs[i];
}
}
if (null == info)
return null;
else
return GetImageFormat(info.FormatID);
}
public static ImageFormat GetImageFormatForMime(string mimeType)
{
ImageCodecInfo info = null;
ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();
for(int i=0; i<codecs.Length && null == info; i++)
{
if (0 == string.Compare(codecs[i].MimeType, mimeType, true))
info = codecs[i];
}
if (null == info)
return null;
else
return GetImageFormat(info.FormatID);
}
public static ImageFormat GetImageFormat(Guid formatID)
{
Type tImageFormat = typeof(ImageFormat);
PropertyInfo[] props = tImageFormat.GetProperties(
BindingFlags.Public | BindingFlags.Static);
for(int i=0; i<props.Length; i++)
{
PropertyInfo prop = props[i];
if (tImageFormat == prop.PropertyType)
{
ImageFormat fmt = (ImageFormat)prop.GetValue(null, null);
if (fmt.Guid == formatID)
return fmt;
}
}
return new ImageFormat(formatID);
}
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hello,
I'm using the WebBrowser control in an application in C#.
I created an UserControl embedding the WebBrowser control.
I have a form including one of this UserControl.
I also have a thread that makes calls to the Navigate()
method of the WebBrowser control. This thread
automatically navigate to several hundred of pages and
sites. It waits for several minutes for a page to load and
then traverse its DOM.
Everything works nicely but after a while (time vary, page
involved too) I always get a COMExption error when calling
the Navigate() method: "Requested resource is in use".
I'm really stuck with this problem which compromise the
program stability. Any help or ideas will be greatly
welcome.
Thanks,
R. LOPES
Just programmer.
|
|
|
|