|
How do I make a panel on a tabpage highlightable so that whatever text on it can be highlighted?
|
|
|
|
|
I've have an annoying iss when trying to print a page in Windows form.
printDocument1.DefaultPageSettings.Landscape = true;
This sets the page to landscape no problem, but when I try to get the PrintableArea it is still in Portrait mode (800x1100) rather than Landscape (1100x800). I've worked around this, but it is annoying, I would expect the PrintableArea to update appropriately.
Does anyone have an explaination or a way to get the settings properly? Did I miss something?
|
|
|
|
|
Hello
Well, we don't have your entire code to look at, but why don't you try using the PrintPageEventArgs.MarginBounds Property instead?
NB.
If you try to change the Landscape property inside the PrintPage event it won't work!!! I geuss you already know that.
|
|
|
|
|
MarginBounds is different from PrintableArea, but thanks for the response. It also has nothing to do with the code but here you go
<br />
private void OnPrint(object sender, EventArgs e)<br />
{<br />
printDocument1.DefaultPageSettings.Landscape = true;<br />
}<br />
<br />
private void OnPrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)<br />
{<br />
e.Graphics.DrawRectangle(new Pen(Color.Red), e.PageBounds);<br />
e.Graphics.DrawRectangle(new Pen(Color.Yellow), e.MarginBounds);<br />
e.Graphics.DrawRectangle(new Pen(Color.Black), e.PageSettings.PrintableArea);<br />
}
The last is what annoys me, I would expect it to in landscape by it is still in portrait.
-- modified at 11:36 Tuesday 27th June, 2006
|
|
|
|
|
Hello
I can see now your problem. I know that printablearea is not updated, that's why I purposed using MarginBounds instead.
Well, if you insist, try inverting them -ie using height as width and vice versa-, but I think this would be a very poor programming practice
a quote from MSDN remarks on PrintableArea:
"The PrintableArea property returns the correct value, whether the page orientation is landscape or portrait."
Do they mean it's changed when you change the Landscape property, or it doesn't matter?? I made a sample and changed the landscape property, but it was the same
I even changed the PaperSize, yet no hope.
Well, I hope this was -somehow- helpful
|
|
|
|
|
As a followup to my previous post here[^], I tried to google to find definitions of how to define the string to pass within a .ToString() call, but all I was able to find was a swath of forum questions like my previous one, and a few answers, but no concise list.
What I'm looking for is a list of what can go into the .ToString() function and what the funcitonality of each character is. Can anyone give me a point in the right direction?
|
|
|
|
|
|
|
.ToString() comes from a base class. All object that you created, will derive this .ToString(). That means each class has its own .ToString(). Which .ToString() do you mean ?
|
|
|
|
|
Start at MSDN[^] The links to various pages therein will tell you everything you need to know.
|
|
|
|
|
|
That was exactly what I was looking for. I completely zoned out and forgot to check MSDN, but this link has more than what I was looking for. Thanks
|
|
|
|
|
Hi.i am still learning C# so i am trying to create a simple class for greeting message so i want to display this message on a label on form.please send me a sample and explanation.
|
|
|
|
|
using System;
using System.Windows.Forms;
namespace TestForm
{
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.ComponentModel.Container components = null;
public Form1()
{
this.SuspendLayout();
this.label1 = new System.Windows.Forms.Label();
this.label1.Location = new System.Drawing.Point(24, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(72, 16);
this.label1.TabIndex = 0;
this.label1.Text = "Hello World";
this.Controls.Add(this.label1);
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(120, 61);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
}
|
|
|
|
|
Not sure what you mean... Probably this?
MessageBox.Show("Welcome!");
There are some overloads to change the title, icon, buttons etc. as well.
|
|
|
|
|
how to find all ip adress in my network???????????
|
|
|
|
|
|
Hi,
I'm using NetworkStream to sending and receiving data.
The problem is that I'm sending very fast arrays of bytes (size 20000) and i'm receiving some thrashes(I mean the arrays that i didn't send).
Has anyone had this problem?
|
|
|
|
|
hi all !
how can i send sms and recieved sms via using c#.
plz help me.
thanks a lot ,
s_mostafa_h
|
|
|
|
|
|
I'm able to retrieve embedded resources like Bitmap s and String s using the properties that Visual Studio 2005 adds to Resources.Designer.cs (or using the ResourceManager in that same file). But for some reason I have not succeeded in doing the same with a Cursor . Visual Studio only accepts a cursor as a file, thus giving me a byte array instead of a Cursor object.
Of course I can do it the "old-fashioned" way, like this:
System.Reflection.Assembly MyAssembly = System.Reflection.Assembly.GetExecutingAssembly();<br />
Cursor MyCursor = new Cursor(MyAssembly.GetManifestResourceStream("MyProject.MyCursor.cur"));
But still, I would prefer it I could treat cursor the same other resource types.
Am I missing something or is this simply an ommision on the part the Visual Studio crew?
Speaking of cursors, why does C# only seems to support monochrome cursors?
|
|
|
|
|
jjansen wrote: Speaking of cursors, why does C# only seems to support monochrome cursors?
Well the framework is simply dumb at this point. Its even mentioned in the documentation of the Cursor class that only not animated monochrome cursors are supported.
|
|
|
|
|
I had hoped C# 2.0 would have corrected this shortcoming. I really miss that colourful swimming jellyfish from Windows95
|
|
|
|
|
In my Embedded Image Grabber[^] tool, I managed to pull cursors out of embedded resources. I think that I did a byte-for-byte copy into a file and then loaded that, or something...
The source code is available in the article.
Josh
|
|
|
|
|
Josh Smith wrote: In my Embedded Image Grabber[^] tool, I managed to pull cursors out of embedded resources.
It would appear you're using the same method as I currently am, ie. by getting a manifest resource stream from the assembly. Effective, but not as "fancy" as through the Resources property .
|
|
|
|