|
I don't think taht you can.
Just create a new form, tuen off the border and caption, then set the listbox to the same size as the form.
Paul Watson wrote:
"At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
|
|
|
|
|
Are there any samples how to use IrDAClient ?
The MSDN doc is very bad for this class (no samples)!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
How can I convert the Graphics object back to a bitmap? I see alot of stuff for one way conversion, but no way to send it back.
Graphics n = Graphics.FromImage(Image.FromHbitmap(tempBitmap.GetHbitmap()));<br />
n.DrawLine(new Pen(new SolidBrush(Color.Beige)),StartPoint,EndPoint);
|
|
|
|
|
I think I'm going to feel a little stupid if the I am correct. But does the above code actually draw on the image.
|
|
|
|
|
|
I wanna ask the same question badly.
if you do:
Graphics n = Graphics.FromImage(tempBitmap);<br />
n.DrawLine(pen,StartPoint,EndPoint);
this will change the tempBitmap;
However,
if you do:
Graphics n = Graphics.FromImage(tempBitmap);<br />
Graphics h=pictureBox.creategraphics();<br />
h.DrawLine(pen,StartPoint,EndPoint);
n=h;
this doesn't seem change tempBitmap.
May some one explain this?
in one word, how do I save everything in the current pictureBox[something are drawn by graphics] into a bmp?
|
|
|
|
|
Think of the Graphics object as being a paint brush, and a Bitmap as being a canvas.
In your 2nd code example, you created a paint brush called "n" but did absolutely nothing with it. You then created a paint brush called "h" but incorrectly set it's canvas to be a PictureBox object - keeping with the anologies, the PictureBox object would be the frame, the actual canvas would be PictureBox.Image.
The basic fix for your code would be:
Graphics n = Graphics.FromImage(tempBitmap);<br />
n.DrawLine(pen,StartPoint,EndPoint);<br />
pictureBox.Image = tempBitmap;
Hope this helps..
|
|
|
|
|
I Get the Following error inside the "Windows form
designer generated code" section for the imagelist that
I've set up for a treeview:
An unhandled exception of
type 'System.Resources.MissingManifestResourceException'
occurred in mscorlib.dll
Additional information: Could not find any resources
appropriate for the specified culture (or the neutral
culture) in the given assembly. Make
sure "ServerComboBoxForm.resources" was correctly
embedded or linked into assembly "ServerComboBox_Test".
baseName: ServerComboBoxForm locationInfo:
NetworkManagement.Demo.ServerComboBoxForm resource file
name: ServerComboBoxForm.resources assembly:
ServerComboBox_Test, Version=1.0.1140.19047,
Culture=neutral, PublicKeyToken=null
Error occurs on this line of the InitializeComponent method:
this.imageList1.ImageStream =
((System.Windows.Forms.ImageListStreamer)
(resources.GetObject("imageList1.ImageStream")));
Can anyone tell me what the problem might be?
thanks.
.
|
|
|
|
|
If you're using a manifest file to make Visual Studio .NET display the XP visual styles, you'll need to create a manifest file for your application too. I got this non-sense error message some days ago, and learned that if you use a manifest file in VS.NET, then build a project, you'll need a manifest file to run the application...
Hope it helps.
John
|
|
|
|
|
John,
thank for the reply... not sure if I'm using a manifest file or not, how do I tell..??? I can add image lists to similar projects without a problem... I find it strange that the error occurs in Windows generated code...
How do I go about creating a manifest file?
|
|
|
|
|
I have had this same problem with VS.NET many, many times - for me it happens when I add my own class *before* a VS.Net generated class; e.g. You derive from the TreeView, but add your own TreeViewItem class in the same code page before the TreeView code. The workaround is to keep the VS.Net class as the first class. Don't know if this is the same problem you're having, but the symptoms are certainly the same.
|
|
|
|
|
Furty,
thanks for the reply... this doesn't seem to be the case for me... the "code page" as you call it, contains only the form class definition, and everything is generated by Windows... the subclased treeview class lives in a different sourcefile, and is only referred to when I instantiate a new treeview item in the form class...
any more suggestions are welcome
|
|
|
|
|
ever figure this one out? im getting the same issue with an imagelist for a toolbar.. dont the problem until i add an image to the imagelist.. exact same error..
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Look at the reply from "furty" above, this was my problem... I had declared something before the windows generated class, and the problem went away when I moved it further down in the source file...
hope this helps...
|
|
|
|
|
i ended up just making another form and using it.. as for saying you 'had declared something before..' do you mean where you declare your variables at the top of the class (where it generates all the textbox variables, etc.) or do you mean in the initializecomponent() section?
thanks! hopefully i wont run into this problem again..
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
yes, I had added some declarations between the namespace declaration and the windows-generated form class declaration... once I moved those out, the problem went away...
|
|
|
|
|
double x, y, z;<br />
x = 41.3;<br />
y = 41.2;<br />
z = x - y;
If I perform the above operations, z should equal 0.1. Right??
But NO... .NET says that 41.3 - 41.2 = 0.099999999999994316.
Am I just being too demanding expecting to be able to get a precision in the first decimal place?? Or am I missing something?
-Michael Bray
mbray@ctiusa.com
|
|
|
|
|
Math.Round
Math.Round(3.44, 1); //Returns 3.4.
Math.Round(3.45, 1); //Returns 3.4.
Math.Round(3.46, 1); //Returns 3.5.
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
OK, but tell me why I should have to do this?? What if I don't know the precision to expect, such as in the code that follows... What could I possibly put in the GetDifference(...) function that would know what level of rounding to perform? I'd have to iterate over several different rouding precisions, and that is just stupid.
<br />
public double GetDifference(double x, double y)<br />
{<br />
return x - y;<br />
}<br />
<br />
GetDifference(41.3, 41.2);<br />
GetDifference(41.33, 41.32);<br />
GetDifference(41.333, 41.332);<br />
-Michael Bray
mbray@ctiusa.com
|
|
|
|
|
fuzzylintman wrote:
OK, but tell me why I should have to do this??
Because double is much less accurate than a decimal. Have you tried using decimals instead? Is this monetary? Use a lower denominator (e.g. in penny value). There was a long discussion on this a few days back.
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
|
Hi, all:
I have a simple WinForm application. I added a HelpProvider control to the form and I can provide Help to individual controls and form. I can not figure out how to call the TableofContents from a menuItem ( say &Content ) under main Menu Help. ( the old MFC way ). What should I do inside the menu item event handler? Thanks in advance.
Dion
|
|
|
|
|
Hi,
try using the Help class in your menuItem handler
Help.ShowHelp(parent,_helpfile.FullName);
where parent is the parent control or form, and _helpfile.FullName is the path and file name of your chm file.
Also note that the folliwng works to navigate to a specific help topic, incase you want to do this..
Help.ShowHelp(parent,_helpfile.FullName,key);
where key is a string.
To determain the key for a topic in your help file:
1)open your help file and goto the topic you want the key for.
2)right click in the topic(MainWindow, not the contents tree) and select properties.
3)in the properties window you will see an address like the following:
mk:@MSITStore:C:\Documents%20and%20Settings\Amber\Desktop\ShuttleThermalFix\ShuttleThermalFixHelp.chm::/ThermalTransfer/ReEntry/HOWTO.htm
Your KEY is everthing after ".chm::/"
so the following method call will launch help to the above topic:
Help.ShowHelp(parent,_helpfile.FullName,"ThermalTransfer/ReEntry/HOWTO.htm"
);
Hope this helps.
Amber Star
|
|
|
|
|
Hi!
Please help me! I hava a problem.
How I can check Keyboard buffer is empty or not?
For instance
do
{
// do something
} while (CharFromKeyBoard != "q");
System.Read and SystemReadLine waiting user input, but I need do some operation until user press some key, for instance char "q".
Sorry my English.
|
|
|
|
|
Try something like this (especially StreamReader.Peek() ):
StreamReader reader = new StreamReader(Console.In);
try
{
reader = new StreamReader(Console.In);
do
{
} while (reader.Peek() != 113);
}
finally
{
if (reader != null)
reader.Close();
}
Reminiscent of my younger years...
10 LOAD "SCISSORS"
20 RUN
|
|
|
|