|
We know the label in DevExpress .NET v7.1 controls can change its forecolor augomatic when the skin changed.But I found that the checkedit can not change its forecolor augomatic when the skin changed.
My question is How to change the checkedit's forecolor augomatic when the skin changed.
Thanks a lot!
|
|
|
|
|
You are seeking assistance with a third party tool. DevExpress has their own support forums, you should seek assistance there.
Here are the forums: http://www.devexpress.com/Support/Forums.xml[^]
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
Hi
plz if anyone can help
this is the code
{
string str = "bahaa";
int result = Convert.ToInt32(x);
}
it gives an exception "Input string was not in a correct format."
|
|
|
|
|
??
there is something wrong I think.
Convert.ToInt32() normally takes a string; I dont know what x is.
if you meant Convert.ToInt32(str);
then obviously that would fail because str does not look like a number at all.
|
|
|
|
|
yes that what i meant but can't i change it to assci code
|
|
|
|
|
Convert.ToInt32() expects a string that represents an integer, such as "123" in which case
it would return 123
if you want the integer value of an ASCII character you could do something like:
string str="bahaa";
char c=str[0];
int i=(int)c;
|
|
|
|
|
Luc Pattyn wrote: if you want the integer value of an ASCII character you could do something like:
string str="bahaa";
char c=str[0]; // gets first char
int i=(int)c;
Strictly speaking it's not at all an ASCII character, it's a Unicode character, as strings in .NET are Unicode, not ASCII.
---
single minded; short sighted; long gone;
|
|
|
|
|
Right.
I should have written "if you want the integer value of a character ..."
|
|
|
|
|
Hi All,
What is difference between these two initializations of _obj:
1)
<br />
public class Class1<br />
{<br />
public Class1()<br />
{<br />
}<br />
private Class2 _obj = null;<br />
}<br />
2)
<br />
public class Class1<br />
{<br />
public Class1()<br />
{<br />
_obj = null;
<br />
}<br />
private Class2 _obj = null;<br />
}<br />
Would there be difference between 1) and 2), if Class2 is a class from another referenced dll?
|
|
|
|
|
Hi,
with your code it is the same because both contain a line
private Class2 _obj = null;
furthermore an object reference is null by default when it is a class member.
There are circumstances where there would be a difference; examples:
1) when _obj has to be initialized to something other than null, and its value is
required before an object of Class1 is being instantiated (maybe its needed by some
public static methods/properties).
2) when the constructor would fail (throw an exception) and hence not reach the
initialization statement.
|
|
|
|
|
Me too thought that the initilizations in 1) and 2) were same.
But I had a problem in Design mode when 2) was used.
I could solve the problem when 1) was used instead.
I am just too confused. I dotn find any reason why it behaves differntly.
Let me explain in deatil.
MyClass1 is a UserControl class. MyClass1 is to be used in frmMain (Main Form)class.
MyClass2 is a class in another dll which is referenced in the project and used in MyClass1.
I have two Confusions:
Confusion-A) The designer of MyClass1 opens fine even if 1) or 2) is used.
Confusion-B) assuming I use method 2) - When I try to add the UserControl class MyClass1 in the designer of frmMain, I get an error that it could not add the control. Mysteriously enough if I use method 1) instead, everything worked fine.
Since MyClass2 is in another dll, would it initialize it differently if initialized in constructor or while declaring it?
Note: Both ways the _obj is initialized as null.
|
|
|
|
|
ArtiGujare wrote: Confusion-A) The designer of MyClass1 opens fine even if 1) or 2) is used.
That's good.
ArtiGujare wrote: Confusion-B) assuming I use method 2)
OK, I am not sure but this is what I expect is happening:
- the line private Class2 _obj=null; does not do much: it reserves a 4 (or 8) byte
reference which is defaulted to zero; it does not need to know what Class2 actually is,
so the compiler will insist on knowing Class2, but at run-time Class2 is not needed,
since there is no code corresponding to this line.
- the line _obj=null; in the constructor is assigning to a variable of type Class2; at
run-time this is the first time Class2 is referenced, so the JIT will try to load and
compile it (although the statement does not require any knowledge of Class2, by definition
this is when Class2 needs to get initialized). Now at design time (which also runs the
constructor), it will fail to find the dll containing Class2 since it searches relative
to the location of Visual itself, not your project. This I guess is the issue you must
solve, but no I do not know how.
Hope this helps.
|
|
|
|
|
Hi,
Im trying to trim a peice of text, the below code is how i do it:
StringFormat stringFormat = new StringFormat();<br />
stringFormat.Trimming = StringTrimming.EllipsisCharacter;<br />
Font font = new Font(FontFamily.GenericSansSerif, 10, FontStyle.Bold, GraphicsUnit.Pixel);<br />
RectangleF rect = new RectangleF((float)Layout.X + 25, (float)Layout.Y + 10, (float)Layout.Width - 25, (float)Layout.Height - 10);<br />
<br />
g.DrawString(nodeTag.NodeName, font, Brushes.Black, rect, stringFormat);
Layout is the rect values of a node i draw, i then draw the text on top, and if its to big, trim it. The problem im having is that instead of trimming the text and replacing the charactors with "...", it puts the affect text on a new line which i dont want to happen.
Any ideas?
Regards,
Gareth.
|
|
|
|
|
Hi Gareth,
I guess your rect is too high; I expect DrawString to trim only if the text does not fit
the given rect.
Remedy: reduce rect.Height or add StringFormat.NoWrap to your StringFormat.
|
|
|
|
|
Hi Luc,
As you suggested, StringFormatFlags.NoWrap fixed my problem.
Thanks,
Gareth.
|
|
|
|
|
Hi there.
I have the following XML file:
resource identifier="6B3B1BD6_FB84_4B23_8B50_29E6EAA07429" width="380" height="280" type="image/jpeg">
uri>img012.jpg");
}
}
|
|
|
|
|
hi
i want to extend the standard DataGridView in vs 2005 mySelf, and i want to add footer to DataGridView,this is my code to override paint method :
public partial class ExGridView : DataGridView<br />
{<br />
private int _footerHeight;<br />
public ExGridView()<br />
{<br />
InitializeComponent();<br />
_footerHeight = 20;<br />
}<br />
<br />
public int FooterHeight<br />
{<br />
get<br />
{<br />
return _footerHeight;<br />
}<br />
set<br />
{<br />
if (_footerHeight != value)<br />
{<br />
_footerHeight = value;<br />
Invalidate();<br />
}<br />
}<br />
}<br />
<br />
protected override void OnPaint(PaintEventArgs e)<br />
{<br />
base.OnPaint(e);<br />
Rectangle rOrginal = this.ClientRectangle;<br />
Rectangle rFooter = new Rectangle(0, this.Height, this.Width, _footerHeight);<br />
e.ClipRectangle.Offset(0, _footerHeight);<br />
e.Graphics.DrawRectangle(Pens.Black, rFooter);<br />
e.Graphics.DrawString("Test", this.Font, Brushes.Black, new PointF((float)rFooter.X + 10, (float)rFooter.Y + 5)); <br />
}<br />
}
but when compile my app and add myControl (ExGridView) to my form, nothing occured, where does problem and how to solve it ?
|
|
|
|
|
Hello,
I am adding a bunch of usercontrols to a flow layout panel, but it takes a very long time for the controls to show up in the flowpanel. Is there a way to speed up the process? There are almost 600 controls that are added to the flowpanel.
Thank you
|
|
|
|
|
Are you creating the controls individually and then adding them to the panel by calling panel.Controls.Add ?
You might want to create your controls and add them to an array or List<Control> . Once all of the controls have been created, add them to the panel by calling panel.Controls.AddRange .
This should provide some noticeable speed improvements. Also, be sure to call SuspendLayout before you start adding controls and then
ResumeLayout<code> when you are done. <br />
<br />
<div class="ForumSig">-----------------------------<br />
In just two days, tomorrow will be yesterday.</div>
|
|
|
|
|
i need to make a pdf and zip file in my code,but it makes error !
at first it was because of vjslib and vjscore dlls ,but i call to the host ,and they add these dll to .net framework,now it cause new error
"Exception of type java.lang.ExceptionInInitializerError was thrown"
how could i solve it?
please help me.
|
|
|
|
|
Hello again every buddy,
I'm trying to use a few shortcut keys in my Windows Form I'm using C# 2.0 and I wanted to makea functionality such that the control goes to a toolStripTTextBox after the user presses the combination of CTRL+G.
thanks in advance
Rocky
|
|
|
|
|
Hi,
I see two ways of achieving this:
- use keyboard events to detect G key and check for simultaneous CTRL key
(with Control.ModifierKeys)
- or use a MenuItem in some Menu, and give it the right Shortcut.
Finally, in the relevant handler call myCcontrol.Focus().
|
|
|
|
|
I would like to serialize a Data Class to an XML File. I know this was possible with Enterprise Library 2006 Jan version using 2 or 3 lines of Code. Any info if this is possible in System.Configuration of .NET 2.0 or Enterprise Library 3.0 version?
Example class:
Public partial class Employee
{
public int ID;
public string Name;
public Address empAddress;
}
public partial class Address
{
public string firstLine;
public string secondLine;
}
I would like to serialize the Employee Class to a Config file. (let's say EmpData.config)
Appreciate a quick response on this.
-- modified at 8:42 Tuesday 12th June, 2007
|
|
|
|
|
You don't need the EntLib to serialize your class. Use XmlSerializer
XmlWriter writer = XmlWriter.Create("EmpData.config");<br />
XmlSerializer serializer = new XmlSerializer(typeof(Employee));<br />
serializer.Serialze(writer, employee);
only two letters away from being an asset
|
|
|
|
|
Thanks for your input.
I don't want to use XMLSerializer. Is this possible using EntLib or System.Configuration?
I remember something was there in EntLib 1.1 - Configuration.Write(FileName, Object);
Something similar in EntLib or in C# 2.0?
|
|
|
|