|
Sorry. I still havent gotten my thingy yet. Looks like I have to trouble you all again.
That time you said by creating a font object, I can display the values in a sample display.
I have searched the net regarding font object but there is no detailed explanation on it.
Can you show me an example so that I can understand better?
sorry for the inconvenience caused.
|
|
|
|
|
There is nothing in Font object...
First you create a Form..
Place 3 buttons. and one Rich Text Box.
now name three buttons as bold, underline, and italic.
Give some text to richtextbox. e.g.Sample Line.
Take a Font object at the topmost part of the class.
e.g. Font fnt = new Font();
Now on buttons click events... e.g. buttonbold click event write this.
fnt.Bold = !fnt.Bold; //This will invert the bold .
txtsample.Font = fnt; //This will change the text according to the font you have changed.
And see the difference in Textbox..
If this works , just make other button events as you like. .
Go step by step...
You may get it. .
|
|
|
|
|
I have just tried out the method that you suggested. But there's an error in the program.
I think I know what goes wrong and I am now figuring out the way to correct it. Thank for your suggestion. I will try to understand it and get back to you again if I still got problems.
Grateful for your help!
|
|
|
|
|
My pleasure dude. .
You can share the error you got. .
Might be helped by someone else. .
|
|
|
|
|
hmm..okay..
one of the error said that System.Drawing.Font cannot be assigned. It is read-only. In this case, how do I assign my combo box value to get the displayed font?
|
|
|
|
|
Just keep a button and a label or richtextbox in one form. And place these two lines of code on button press event.
this.fontDialog1.ShowDialog();
this.label1.Font = this.fontDialog1.Font;
|
|
|
|
|
hmm..do you have any idea on how to add buttons into the default font dialog interface?
|
|
|
|
|
|
really thanks alot for ur help again!!
I have gotten one part of it..I went to the website that u have gave me..but this time round I have to display a button 'advanced' to provide more options to the user..I have searched a while but so far I have nothing..
do you have any idea on how I can do it?
|
|
|
|
|
I also read that article,....
It was getting much harder than what I expected...
But Ya , when I was searching for something what I can understand (Really , I ws not able to understand much of that given in MSDN). I came accross a very good article being posted on this site...
It was on custom color dialog box.. where he inserts a slider button which changes the alpha value of the color.. And I found it much interesting and usefull...
And according to your requirement, you need something added to default, if one can add a slider you can also get some very good things from it...
but ya you might need to do some Research and just go for try and error in font dialog...
The link is :
http://www.codeproject.com/KB/graphics/Custom_Color_Dialog_Box.aspx[^]
Hope it helps you. . .
|
|
|
|
|
hmm..okay..I will look through the article you have provided and try it out..maybe it just works..
thanx for your help all this while!
|
|
|
|
|
|
Hi all,
Is it at all posible to make use of the value of a textbox within the report(.rdlc file)?
If I can give an example:
Lets say you want to get hold of the value that is stored in textbox10 within the report and make use of it in a calculation (Expression window).
How can I get hold of the value that is stored within the report textbox?
Many thanks in advance
Kind regards,
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
Within the expressions window enter the following:
ReportItems("textbox").Value
Or see this[^] web site.
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
I want to compare two objects of different versions and display there differences in UI.
First I call a method to know if there is any difference between the two objects
The method is as -
public bool AreEqual(object object1,object object2, Type comparisionType)
If the above method returns true
I call GetDifferences method to get the differences which is as -
public ObjectDifference[] GetObjectDifferences(object object1, object object2, Type comparisionType)
{
ArrayList memberList = new ArrayList();
ArrayList differences = new ArrayList();
memberList.AddRange(comparisionType.GetProperties());
memberList.AddRange(comparisionType.GetFields());
for (int loopCount = 0; loopCount < memberList.Count; loopCount++)
{
object objVal1 = null;
object objVal2 = null;
MemberInfo member = ((MemberInfo)memberList[loopCount]);
switch (((MemberInfo)memberList[loopCount]).MemberType)
{
case MemberTypes.Field:
objVal1 = object1 != null ?((FieldInfo)memberList[loopCount]).GetValue(object1):null;
objVal2 = object2 != null?((FieldInfo)memberList[loopCount]).GetValue(object2):null;
break;
case MemberTypes.Property:
// object temp = ((PropertyInfo)memberList[loopCount]).
objVal1 = object1!= null ?((PropertyInfo)memberList[loopCount]).GetValue(object1, null) :null;
objVal2 = object2 != null? ((PropertyInfo)memberList[loopCount]).GetValue(object2, null):null;
break;
default:
break;
}
if (AreValuesDifferentForNull(objVal1, objVal2))
{
ObjectDifference obj = new ObjectDifference(objVal1, objVal2, member,member.Name);
differences.Add(obj);
}
else if (AreValuesDifferentForPrimitives(objVal1, objVal2))
{
ObjectDifference obj = new ObjectDifference(objVal1, objVal2, member, member.Name);
differences.Add(obj);
}
else if (AreValuesDifferentForList(objVal1, objVal2))
{
ObjectDifference[] listDifference = GetListDifferences((ICollection)objVal1, (ICollection)objVal2,member);
differences.AddRange(listDifference);
}
else if ((!AreValuesEqual(objVal1, objVal2)) &&( objVal1 != null || objVal2 != null))
{
ObjectDifference obj = new ObjectDifference(objVal1, objVal2, member, member.Name);
differences.Add(obj);
}
}
return (ObjectDifference[])differences.ToArray(typeof(ObjectDifference));
}
public class ObjectDifference
{
private readonly object objectValue1;
private readonly object objectValue2;
private readonly System.Reflection.MemberInfo member;
private readonly string description;
public object ObjectValue1 {
get { return objectValue1; }
}
public object ObjectValue2 {
get { return objectValue2; }
}
public System.Reflection.MemberInfo Member {
get { return member; }
}
public string Description {
get { return description; }
}
public ObjectDifference(object objVal1,object objVal2,System.Reflection.MemberInfo member,string description)
{
this.objectValue1 = objVal1;
this.objectValue2 = objVal2;
this.member = member;
this.description = description;
}
For each difference I create an object of type ObjectDifference and add it to the array. The highlighted portion is the one where I am stuck! If the object contains another complex object, My program does give me the differences but I dont know which type it belonged to
For example I have two objects of type Name
class Name{
string firstName;
string LastName;
List<phonenumber> phNumber;
}
class PhoneNumber{
string officeNo;
string MobileNo;
string HomeNo;
}
while comparing two objects the output I get is plain -
firstname - John Mary
LastName- cooper Lor
officeNo - 22222 44444
MobileNo - 989898 089089
HomeNo-- 4242 43535
The Hierarchy that officeNo is of type PhoneNumber is lost. which is important for me to display
How should I maintain this type of tree while creating differences.
Hope I am able to make my problem understood.
|
|
|
|
|
Hi,
A DLL is reffered in a windows application, the dll contain a form. When i call the dll the form is opened. When i close the Form in the dll, i need to pass a value back to the windows application to identify the dll is closed. How can i get the notification?
Thankyou,
YPKI
|
|
|
|
|
There is an event called "Closed". You can hear of that event.
MyForm myForm = new MyForm();<br />
myForm.Closed += new EventHandler(myForm_Closed);<br />
myForm.ShowDialog();<br />
<br />
...<br />
private void myForm_Closed(object sender, EventArgs e)<br />
{<br />
}
|
|
|
|
|
Hi all
I know its stupid but no way out.
lets say
I have 2 forms. activity is...1 form hide another open...vice versa
I have some restriction here. i cant use any button to exit.
I just have only way to click the cross on the top right side of forms.
By clicking cross it will exit all forms.
But now in my program its not working because another form is hidden.
I have to stop it manualy.
Any suggetion pls
Thanks
|
|
|
|
|
On Form_ClosingEvent just write Application.Exit();
This will exit the whole application
|
|
|
|
|
should I mention anything in form.Designer.cs file for handler?
|
|
|
|
|
Just select the form ...
SElect the properties, and go for events...
In events list you may find Form_Closing or Form_Closed event..
Take any one as per your requirement..
Double click there the event will be generated in your class file. .
|
|
|
|
|
Thanks a bunch friend...
i have learned many things by this.
|
|
|
|
|
|
I am using Environment.OSVersion for geting the Operation system version. My application is running on Microsoft Windows XP Professional Service pack 2.
when i try to retrieve the os version see the code snippet:
log.Info("ASET OSVersion=" + Environment.OSVersion);
i am getting the following output:
2009-03-12 14:18:40,483 [INFO ] [3528] - ASET OSVersion=Microsoft Windows NT 5.1.2600 Service Pack 2
The output should be Micorsoft windows xp , but here it is giving some thing else.
Can any one help me in this regard?
|
|
|
|
|
AFAIK XP is recognized as NT platform only. I don't remember it exactly but I think it the OS is determined by 'Environment.OSVersion.version.Minor'. I think if the minor value is 3 it is XP. (I'm not sure...try google)
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|