|
i need to know how to use the PrintDocument and the PrintDialog to print a specific file and specially a form.
thaks
jamil abou khalil
|
|
|
|
|
Hi all,
I need to convert the month number example 4 to "April"
i tried like this...
Convert.ToDateTime(cdata.Birthdate.ToShortDateString()).Month) but this brings back the number 4<br />
Convert.ToDateTime(cdata.birthdate.ToLongDateString()).Month) but this also brings back the number 4 not the word "April"
How do i go about converting the 4 into the month name?
Thank you in advance
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
DateTime.Now.ToString("MMMM")
Although it is culture dependant
|
|
|
|
|
thank you. i've been struggling with this one for a while now...
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
Thank you thank you THANK YOU
i used Convert.ToDateTime(cdata.Birthdate.ToShortDateString()).ToString("MMMM")
and it works great.
I get the month name now. Thank you.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
NarutoFan#1 wrote: Convert.ToDateTime(cdata.Birthdate.ToShortDateString()).ToString("MMMM")
Just a side point, its not necessary to convert a date to a string then back to a date, this could just as easily be
cdata.Birthdate.ToString("MMMM");
|
|
|
|
|
hi
you can use a simple switch statment like:
Switch (monthnumber){
case 1: monthname = "January";
case 2: monthname = "February";
.
.
.
etc
}
Jmail abou khalil
|
|
|
|
|
Hi,
I have a dropdown control with few list item in it. I am setting the
DroppedDown property to true in the textchanged event to show the dropdown, the problem is the mouse coursor (the pointer) is not visible after the dropdown is shown, its stuck
inside the dropdown and only when the focus comes out of the control I am
able to see the Mouse pointer again. Am i missing something.
Regards
Deepak
|
|
|
|
|
i am using a inkpicture box for loading images, i want to draw over that image
so that using ink.and how can i insert ink into that image?
|
|
|
|
|
please ans: i do a graphics project ,i want to known can i draw over a image
using pen or brush.in c#
please response.......
|
|
|
|
|
using (Graphics gr = Graphics.FromImage(image))
{
// Draw on the bitmap using the graphics object
}
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i am using like this.
img = (Bitmap)Bitmap.FromFile(ofd.FileName);
Graphics gr = Graphics.FromImage(img);
gr.DrawEllipse(new Pen(Color.Black), new Rectangle(300, 300, 10, 50));
doc[1].inkPicture1.Image =
and i am using a ink picture box how to add his graphics object to this picture box
|
|
|
|
|
sathishtl007 wrote: how to add his graphics object to this picture box
You don't. You add a bitmap to a picture box, and you use a graphics object to change a bitmap.
doc[1].inkPicture1.Image = img;
should show your ellipse, assuming it's not on a bitmap that's all black anyhow. ( and that the bitmap is larger than 300 x 300, otherwise, you drew it off the bitmap )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
one more Question ?
how to place a image over an image?
and how can i save this grouped images?
|
|
|
|
|
sathishtl007 wrote: how to place a image over an image?
gr.DrawImage will draw an image into a graphics object. If that graphics object is made from another Image, they get drawn onto each other
sathishtl007 wrote: and how can i save this grouped images?
That's two questions
Just to be clear - you have only one bitmap, the bitmap you draw over it is not a grouping of images, it's a bitmap where a block of pixels has been changed to look like the source bitmap.
The Bitmap class has a Save method.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Im using an external dll called yWorks. I need to strong name it to work with my project. I've read into sn.exe and al.exe, but cant seem to get it working.
Any help would be greatful.
Regards,
Gareth.
|
|
|
|
|
I found the answer to my question, thus i thought i would reply to my self incase anyone else ever searched for the same problem.
http://research.microsoft.com/~mbarnett/ILMerge.aspx
The above link is what you should use if you ever need to sign a dll which you have not created with a strong name.
Regards,
Gareth.
|
|
|
|
|
Clickety[^]
Use the link[^] command below to make your link usable.
|
|
|
|
|
Hi I am sure this is a stupid question, but I can't work it out and its driving me mad.
I have a asp.net C# web page. (Visual Studio 2005)
In the class declarations at the top I have declared a
<br />
Public String strTeacherName;<br />
In a button click method I give the string a value
<br />
protected void btnBook_Click(object sender, EventArgs e)<br />
{<br />
strTeachername = "xxx";<br />
}<br />
In a second button click methods I try to use the variable, but it is empty
<br />
protected void btnConfirm_Click(object sender, EventArgs e)<br />
{<br />
lblMessage.Text = "You booked your lesson with " + strTeacherName;<br />
}<br />
I am assuming that the second postback is clearing the value of strTeachername. What is the best way of passing the variable from one method to the other. At the moment I am using a Session variable, but that can't be the best way.
Any advice greatly appreciated...
Words fade as the meanings change, but somehow, it don't bother me.
|
|
|
|
|
i can not see any error in the way u are using the variable. you should look on another place where you are using this variable and making it empty. Try the find utility (Ctrl + F) and type the variable name it will lead u at all the places where the variable is found.
if you can provide all the code, maybe i can help more
Jamil abou khalil
|
|
|
|
|
That's because it's an ASP.NET question.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
This question is better in the ASP.NET Message-Board
I'm not so good in ASP.NET but i think you must it store in the session variable.
Because the page is loaded all the time aat new, so all informations are cleared (re-settet)
The Session-Object is all the time avaible. There you stock normally the choises of the Visitor or his
entered infos ...
So, why not the Teachers Name
You can also pass the Name by sending it to your requested page via URL, for example
But that isn't a good idea
|
|
|
|
|
Your class is regenerated every time you postback. Think of each postback as a new instance of the same class. You have several options, including session state ( lives on the server ) and viewstate ( gets encoded in the page, so goes down to the client ).
Typically, I would do what you're wanting to do with a property, like this:
private const string teacherName = "TeacherName";
private string strTeacherName
{
get
{
string s = ViewState[teacherName];
return string.IsNullOrEmpty(s) ? "" : s;
}
set
{
ViewState[teacherName] = value;
}
}
I put the key for the viewstate into a constant string so that there is never a mix up between them, and use IsNullOrEmpty to not have to deal with nulls in the rest of my code ( it will be null to start with, obviously. )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Making it static will also cause the value to persist between postbacks.
public static string strTeacherName;
|
|
|
|
|
Thanks everyone. I thought the Postback was the problem.
I will try your method Christian, thanks.
Words fade as the meanings change, but somehow, it don't bother me.
|
|
|
|