|
Getting data immediately from DataGrid (see Item in help; DataGrid (Win) Members):
object mydata=myDataGrid[rowNo,columnNo];
You can use DataView used by DataGrid. It's sorted in thesame way as displyed
in DataGrid, so You can use CurrentRowIndex property. This DataView You can get from:
1. DataSource (if it's a DataSet or DataTable) by DefaultView property of DataTable (it's not a good way I think ... I can't speak English well)
2. ListManager.List protected property of DataGrid (only in inherited class)
3. DataBinding (complicated way)
But if You can get DataView it's very pleasant object to use ...
Hi,
AW
|
|
|
|
|
I have a form that has several controls on it all in a panel. Sometimes, the user needs to have read-only access to this form. If I disable the panel, then indeed all controls get disabled. But you cannot tell by looking at the controls that they are disabled. I want to draw on top of the form a graphic that is translucent so everything on the form is dimmed. I might also like the graphic to have a big "X" on it, or perhaps even say the reason that the form is disabled.
I tried several things, but nothing really works. I would be happy if I could even just draw a big red "X" over the form inside a red circle to indicate what I want. But if I draw on the form, my lines fall behind the panel and controls. So I tried placing two panels on the form. This works good, but the panels cannot be rotated, so I end up with a big "Cross" insetad of an "X".
So my question is how can I put a translucent image or rectangle that covers the entire form and all of its panels and controls? Or, how can I draw a line on a form so the line is drawn on top of all other panels and controls on the form? Or how can I rotate a panel so I can draw an "X" on top of the form which will cover all panels and controls on the form.
Or can anyone suggest a better way to indicate to the user that a form is read-only while they are in a particular mode?
thanks
Bryan
|
|
|
|
|
First off I would say the big red X idea is a bad one and that you should leave the default UI behavouir as it is. If your frame has a title then it gets dimmed and that is how 99% of programmes leave it and most users understand this. A big red X may be a bit annoying.
But if you have a valid reason then how about using a transparent GIF (the picture control has a transparency colour setting) and overlaying. Just make it visible when the frame is disabled.
Paul Watson Bluegrass Cape Town, South Africa
Macbeth muttered:
I am in blood / Stepped in so far, that should I wade no more, / Returning were as tedious as go o'er
Want a job?
|
|
|
|
|
I understand your point. I am putting this together for a client who would like to see the "X" if I can make it work. I tried your idea with the picturebox. It almost works, but the image does not seem to support the transparency of the gif. I made the background transparent, and I made a gif with 50% transparency. But the picturebox still does not show through what is under it. It is as if it is showing through to the background image/color of the parent form, and so it is transparent, but all the way to the parent form. So none of my controls show through the picturebox object.
Perhaps you can be more specific on what you have in mind to allow my picture box to be transparent?
thanks
Bryan
|
|
|
|
|
bwells wrote:
Perhaps you can be more specific on what you have in mind to allow my picture box to be transparent?
To be honest I did it once right when I first tried C# out and then never used it after that. I don't know what you mean by a 50% transparent GIF. GIFs only have one channel for transparency meaning you assign a colour to them which is then transparent. Not a percentage based thing. So check your GIF.
Sorry I cannot be of much more help.
Would your client consider having the red circle X behind the form controls? i.e. As the background image of the frame? That would be much easier to do.
Paul Watson Bluegrass Cape Town, South Africa
Macbeth muttered:
I am in blood / Stepped in so far, that should I wade no more, / Returning were as tedious as go o'er
Want a job?
|
|
|
|
|
I am using Macromedia Fireworks. I draw my image, and I specify I want alpha transparency. When I draw a line, I set the opacity of the line to 50%. So what I should have said was opacity, not transparency.
I confirmed what I am seeing is that if I set the background color of the picture box to be transparent, then it shows through to the background of the parent form, in effect, blanking out the controls under the picture box so it looks like a "hole" in the form so you see the form background color where the transparent picturebox is located. It is almost what I want, but I need to have the controls be visible.
I was thinking as well that I could make the background color be red or some other "special" color so you can tell something is different about the dialog when it is up.
thanks
Bryan
|
|
|
|
|
Hi , i need to make an app that reads emails in a specific mailbox
and extract some xml at the bottom of the mail...
what would be the best way to do this?
what classes could i use for this?
i have never coded anything that deals with emails except for some simple email sender stuff in websites...
//Roger
|
|
|
|
|
I have these pieces of code:
public class MyClass : System.Net.Sockets.TcpClient
public MyClass ()
{
MyProperty = new TcpClient ();
}
public TcpClient MyProperty {
get { return MyProperty; }
set { MyProperty = value; }
} And when I execute the following line of code I get a StackOverflow :
private MyClass myNewClass = new MyClass (); If I step through the execution, the program continually calls the set method of MyProperty until the StackOverflow occurs. Any help as to why this is occuring and how to fix it would be very appreciated.
Thanks!
- monrobot13
|
|
|
|
|
Think about it. Your class has a property named MyProperty. In the constructor, you set the value of that property. But the property setter recursively calls itself ("MyProperty = value;"). Instead, you need to declare a private variable _MyProperty, change the setter to "_MyProperty = value;" and the getter to "return _MyProperty;".
Sean Winstead
|
|
|
|
|
Or better yet...adhere to the design guidelines and do myProperty rather than _MyProperty.
any idiot
can write haiku you just stop
at seventeenth syl
-ThinkGeek Fortunes
|
|
|
|
|
Or better yet...adhere to the design guidelines and do myProperty rather than _MyProperty.
Thanks Where can I find the design guidelines?
Sean Winstead
|
|
|
|
|
You can find everything you need (including FxCop) here[^]
any idiot
can write haiku you just stop
at seventeenth syl
-ThinkGeek Fortunes
|
|
|
|
|
|
Thanks, I understand now. I falsely assumed that that part was taken care of automatically.
- monrobot13
|
|
|
|
|
I forgot what *=, += things do...
can somebody refresh my memory?
gracias.
SENOR EGG>
/\ |_ E X E GG
|
|
|
|
|
*= is the emoticon for a man with an afro.
+= is the emoticon for a person who wants to give a hug.
Sean Winstead
|
|
|
|
|
Seriously though,
x *= 5 is equivalent to x = x * 5
x += 5 is equivalent to x = x + 5
Sean Winstead
|
|
|
|
|
ahhhhhh it's all comming back to me....
shanks.
/\ |_ E X E GG
|
|
|
|
|
A+=1 is the equivelant of A=A+1 so I would say A*=3 is the same as A=A*3. I hope that refreshes you!
[Edit]Looks like someone beat me to it![/edit]
"We will thrive in the new environment, leaping across space and time, everywhere and nowhere, like air or radiation, redundant, self-replicating, and always evolving." -unspecified individual
|
|
|
|
|
can i know how to use StartCap and EndCap members of Brush class.i need to use LineCap or nt?can i have some sample code of how to create.thank you.can i do it like this way.
m_PenToDrawWith = new Pen(Color.Red);
m_PenToDrawWith.EndCap=System.Drawing.Drawing2D.LineCap.DiamondAnchor;
|
|
|
|
|
Is it possible to convert a string to an int in C#?
Thanks!
- monrobot13
|
|
|
|
|
There is an Int32.Parse(string) function, but it will throw an exception if the string is not an integer.
|
|
|
|
|
Convert.ToInt32(string str); as well
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
Here's the deal - I have two programs. One is a utility program used to create objects and serialize them to disk. The second program is the real application which, in time, will be able to deserialize these objects and use them.
When I serialize and deserialize within the utility program, I have no problems. However, when I try to deserialize within the main program, I get an error that looks like:
"Type is not resolved for member MyNameSpace.MyClass, MyNameSpace."
I was getting a different error earlier, but I was able to make it further by setting the assembly names to be the same in each program. Is that necesarry and the correct thing to do?
Storing code, roughly:
<br />
Stream myStream = File.OpenWrite(m_sFileName);<br />
if (myStream != null)<br />
{<br />
BinaryFormatter formatter = new BinaryFormatter();<br />
formatter.Serialize(myStream, m_object);<br />
}<br />
Loading code for both programs, roughly:
<br />
if (myStream != null)<br />
{<br />
BinaryFormatter formatter = new BinaryFormatter();<br />
m_object = (MyObject)formatter.Deserialize(myStream);<br />
myStream.Close();<br />
}<br />
Any help is appreciated!
Marcus Spitzmiller
"Why must life be so hard? Why must I fail at every attempt at masonry?" - Homer
|
|
|
|
|
Try to use the Binder property of the formatter. This interface can be used to search for types of different assemblies. Another solution is to put all the assemblies in the GAC.
|
|
|
|