|
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.
|
|
|
|
|
That works! Thanks very much.
I tried Christian's method but I was just getting a stack overflow exception caused by the Set contructor, for some reason. I still have much to learn.
Thank you all for you help.
Words fade as the meanings change, but somehow, it don't bother me.
|
|
|
|
|
No worries. You should probably do some reading as well, to get a better idea of the nature of ASP.NET and how your classes are used to generate HTML.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Yes. I have got a C# book which is good for describing classes and object orientation, and asp.net books which are good for other aspects, but none of them seemed to be able answer this one for me. I think they are too basic. If you have any good suggestions for a suitable book... I have an online voucher for www.ComputerManuals.co.uk to use up.
Words fade as the meanings change, but somehow, it don't bother me.
|
|
|
|
|
Hi everyone,
In a bit of a knot here chasing my tail. I have a webbrowser control embedded in a C# windows app which is calling a .CFM page to provide XML data as an output. I need a way to get this content into a text box in the C# application so as further processing can be carried out.
I am new to C# and would welcome any help that may be provided. The interface works and the webbrowser carries out the action required on the .cfm page it is just the farming of the form fiedl data that is required.
Thank you in advance.
Jarlath
|
|
|
|
|
If you're getting the data as XML, use an XMLDocument and XPath to pull it out.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|