|
Uninstalled and reinstalled the framework and it's fixed. takes only a couple seconds to fire up the first time. Pretty much instant the second time.
|
|
|
|
|
I have a label and I want to change the font style to bold or italic programmically.Can anybody tell me the code?
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
Based on ASP.net work (it may not be the same)
Object.Font.Bold = true;
Object.Font.Italic = true;
Object.Font.Name = "verdana";
etc.
// Rock
|
|
|
|
|
I used this code but there is an error return for it:
E:\....(106): Property or indexer 'System.Drawing.Font.Bold' cannot be assigned to -- it is read only
Any suggestion?
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
ok, I fired up a winforms project and I have no idea. The property is listed as get only in code, but is settable in the designer.
// Rock
|
|
|
|
|
Most of the properties on a Font are read-only; you have to create a new font object and assign it to one you wanted to change.
James
Sonork ID: 100.11138 - Hasaki
"My words but a whisper -- your deafness a SHOUT.
I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
Sorry James,Could you give an example?
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
Mazdak wrote:
Sorry James,Could you give an example?
Certainly
Font newFont = new Font(myLabel.Font,
FontStyles.Bold | FontStyles.Italic
);
myLabel.Font = newFont;
If you want to change more than the font style you'll have to extract all of the needed properties from your old font and pass them to the constructor to the Font class.
ms-help://MS.NETFrameworkSDK/cpref/html/frlrfsystemdrawingfontclassctortopic.htm
The url above is for the .NET documentation; putting you right at the constructor list; since there's way too many for me to want to type
James
Sonork ID: 100.11138 - Hasaki
"My words but a whisper -- your deafness a SHOUT.
I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
Thanks,I'll check it
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
There is a little mistake here James,you should use singular 'FontStyle';)
Thanks again
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
Mazdak wrote:
you should use singular 'FontStyle'
Oh man, today isn't my day! Earlier this morning I made another mistake in the data class thread.
Maybe thats a sign that I should go to sleep!
James
Sonork ID: 100.11138 - Hasaki
"My words but a whisper -- your deafness a SHOUT.
I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
Hi All,
I am currently creating an application that needs to populate a number of arrays and then I need to be able to call them again in different parts of the application.
At the moment I have figured out how to Populate an array if I know how many items I am going to have but how do popualte and array when I don't know how many items there are.
And How do I find out how many items there are in an array once it is populated?
This is what I have at the moment
====================
string[] ClinicNames;
ClinicNames = new string[99];
int j = 0;
while (dReader.Read())
{
ClinicNames[j] = dReader.GetString(1);
j = j + 1;
}
====================
|
|
|
|
|
To find the length of an array, use the Length property:
String[] arr = new String[5];
Console.WriteLine("The array length is {0}.", arr.Length); When you exceed the capacity of your array, you will have to allocate a new array and copy the contents of the old array to the new. You can automate this process by using the System.Collections.ArrayList class which will resize the array when necessary.
--
Peter Stephens
|
|
|
|
|
OK, As I understand AxHost wrapper will allow you to embed ActiveX controls inside C# Container...
Do you know of anything that will do the contrary => allow to embed C# Sharp Control into C/C++ Container...
Thnx...
|
|
|
|
|
I read that there was support for exposing C# controls as ActiveX in early betas, but that feature was dropped before (at least) RC1. Sorry.
--
Peter Stephens
|
|
|
|
|
As I understand cumbersome case, would be to write my own wrapper...
I'm thinking that maybe idiotic, but still valid solution would be to create instance of WebBrowser, persist it with <object> tag that has dynamic CLSID of corresponding C# Object... After that enumerate DHTML and extract IDispact of that <object> element... Very possible... But, Isn't that crazy???
Strange those "young inventors" or "gurus" are forcing us to reinvent the bycicle??!!!... However, solution is there => I hope they don't have plans to rewrite WebBrowser on C# (even on C it's still pretty slow considering DHTML realtime rendering)...
Wow, what a bunc of IDIOTS!!!...
Or maybe we both don't understand something!!!...
|
|
|
|
|
Hi,
I’m trying to implement drag & drop (explorer like application) in my application using C#.
appreciate some guidance on this.
Thanks
|
|
|
|
|
After setting MdiList property to true for a main menu selection and opening several MdiChild forms, a list of child forms with the active form checked is displayed when I click on the main menu selection. How can I detect (capture) when one of the MdiChild menu selections is clicked or selected? Any help or direction would be appreciated.
Kyle
|
|
|
|
|
You need to add the following event to your parent form:
this.MdiChildActivate += new System.EventHandler(this.Form1_MdiChildActivate);
then here is the code for the handler.
private void Form1_MdiChildActivate(object sender, System.EventArgs e)
{
MessageBox.Show (this, sender.ToString());
}
HTH
|
|
|
|
|
Hi All,
This might seem a bit simple but I have been using C# to create my ASP.NET applications and it has been going okay.
Now I am trying to create a windows application and have run into a problem.
I have a form called MainForm which has a button on it, when I click this button I want my other Form 'Form2' to open up.
How do I do this?
Thanks,
|
|
|
|
|
Hi,
Using your form2 as an example;
Form2 myForm2 = new Form2();
Form2.Show();
Cheers
Paul Mason
|
|
|
|
|
|
If you want to open it as a Modal Dialog
Form2.Showdialog()
or
Form2.Show()
to open it as a form (or no modal dialog)
Remember to reference your other form.
Hope this helps.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
I am trying to port some C++ code from PC with some classes using MFC over to UNIX, I dont really want to re-write all of the MFC classes that it uses and was wondering if anyone has seen, these classes re-written in standartd c++
classes are:
CMapStringToPtr
CMapStringToString
CRect
CMapWordToPtr
CObArray
CPtrArray
CMapStringToOb
CObject
CStringList
CPtrList
CString
CMap
Clist
CArrayCInstructionList
any help with this would be greatly appreciated
michael.fellows@amsjv.com
|
|
|
|
|
Most of those are found in STL, which is what you will have to learn before porting.
Some have no direct companion, and you will have to write a port or change the code.
// Rock
|
|
|
|