|
|
if the other suggestion doesn't work, it may be something like or one of those sets. for the return, why not do a keypress event?
surgeproof
-------------------------------------------------------
ithium is the best.
'Science without religion is lame, religion without science is blind.' --Albert Einstein
'The pioneers of a warless world are the youth who refuse military service.' --Albert Einstein
|
|
|
|
|
Use Environment.NewLine, which will guarantee the placement of a newline.
|
|
|
|
|
Not necessarily in the TextBox (which encapsulates the Edit common control). To dislay new lines in a TextBox , the Multiline (inheritted from TextBoxBase ) needs to be set to true , as well as the AcceptsReturn property.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
how can i got the version infomation about the sqlsever and any similar information?
should i use the WMI? but which class should i used in the win32_InstalledApplication?
|
|
|
|
|
Run this query:
SELECT @@VERSION
Or run this SP:
xp_msver
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
I want to get this information in my c# web application in the run time.
is the select @@version could complie and run in the c#?!
|
|
|
|
|
yes.
it will run.. this has no relation with the programming language used.
|
|
|
|
|
Please forgive my stupidity.
i just feel puzzle,how can i use the "select @@version" in the code? would you like to show a example?
Thank you very much
|
|
|
|
|
See SqlCommand in MSDN or search for it in this site or Google to see how to run commands and SP in SqlServer from your C# application. When I test @@version and that SP the second one return informations for me , don't know wht so I recommed second way to you.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
Thank you very much.
i have studyed the WMI for several hours to get the os information and the sql information.
i am not conscious that i could get the sql server information from the sql statement.
So when you told me use "select @@version", i just think how can i use it in the WMI. i am sorry for it.
Thanks a lot!
|
|
|
|
|
I have written a C# Windows form with a panel on top of it. As the program runs, a directory is opened and for each image file in the directory a picturebox is dynamically created and loaded onto the panel. As I create each picture box, I give it a Click event handler (the same function for each picture box) where I want to bring up a SaveFileDialog. This all works fine, however, I cannot figure out how to get to the individual picture box that was clicked on so that I can access the image it contains during the event. Can anyone help?
Thank you,
Dustin
|
|
|
|
|
In your event-handler you have a parameter: object sender , use this.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Just cast the sender to a PictureBox and it will be the one that was clicked on.
private void PictureBox_Click(object sender, System.EventArgs e)<br />
{<br />
PictureBox clickedon = (PictureBox)sender;<br />
<br />
}
|
|
|
|
|
Thanks for the replies.
That was the solution I needed.
I thought it had something to do with the sender object, I had even tried casting it as a PictureBox but kept getting compile-time errors. I never even thought of making a new PictureBox object and assigning it. Thanks again.
Dustin
|
|
|
|
|
DustinMiles wrote:
I never even thought of making a new PictureBox object and assigning it
You are not actually making a new picture box object with the previous code. What is happening is that you are creating a reference to the picture box. The variable is a reference to, not a copy of, the PictureBox.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
How to set background Image of treeview in C#?
I try to code about this problem for long time , but i can't found anyway for set background of treeview in C#.
Anyboby help me , please !!!
|
|
|
|
|
If I rememebr correctly, the TreeView control doesn't support a background image, nor does it support a transparent background. You'd have to draw the control yourself to get an image to show through it or behind the actual tree that is drawn. I can't seem to find any examples of it, but you might want to look into overriding WndProc.
RageInTheMachine9532
|
|
|
|
|
This could be very ugly, if even possible. The Tree-View common control that the TreeView class encapsulates doesn't even support this. The poster's best bet is handling the WM_ERASEBKGND but I'd be willing to bet this wouldn't work.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I'm with you on this, but I can't spend a week researching one small feature of his project...
RageInTheMachine9532
|
|
|
|
|
hello , could anybody help me pls i'm trying to convert a 2d image of a terrain using opengl and C# into a 3d terain
thanks
MTSHEDID
|
|
|
|
|
It depends on what kind of 2d terrain you have. If your terrain is a bump map, like what you see on a globe, where different colors or intensities correspond to different heights, then all you have to do is set for each pixel in your 2d terrain a pixel of the same height in your 3d model. So for every point (x,y) in 2d, there would be a point in 3d (x,y,z=(intensity of(x,y))/(maxintensity-lowestintensity)*scale), where your scale is something you define. However you would have to define how to connect these points in 3d using GL.Polygons, GL.Triangles, etc. Your normals would be the cross product of dx and dy. If intense2d(x,y) corresponds to the color or intensity in your 2d terrain, depending on how its defined in your terrain map. Your basic code would be:
<br />
float maxint = maximum intensity in your 2d terrain.<br />
float minint = minimum intensity in your 2d terrain.<br />
float scale = maximum altitude/maximum intensity in 2d terrain.<br />
float zscale = scale*(maxint-minint)<br />
for each x and y in 2d image <br />
float dx= intense2d(x+1,y)-intense2d(x,y), dy=intense2d(x,y+1)-intense2d(x,y);<br />
Vector norm = cross(new Vector(1,0,dx), new Vector(0,1,dy)); <br />
Gl.glNormal3f ( (float)norm.x, (float)norm.y, (float)norm.z );<br />
Gl.glVertex3f ( (float)x, (float)y, (float)intense2d(x,y)/(zscale));
If you are putting this terrain onto an object, then you might not neccesarily want to set the height, but just the normals at their corresponding location, which is bump-mapping.
This is the basic idea, otherwise you would have to be more specific.
|
|
|
|
|
thank u very much i'll try it out right away
MTSHEDID
|
|
|
|
|
I've developed a Power Point add in which works well enough right now (except it doesn't interact with PowerPoint (other than the button on the toolbar) yet.
Essentially it automates some background processes for the creation of some multimedia.
In any case I've found it very difficult to find good articles and/or code examples out there for actually manipulating powerpoint itself (or any other office app for that matter).
Perhaps I've been entering the wrong search criteria...I don't know. In any case the C# Code Project community has been VERY helpful in the past, so I just wanted to ping your # minds for some reference materials be they web sites or books.
I *have* found several books out there but have not yet had a chance to look any of them over. So any recommendations would be great.
--Tony Archer
"I can build it good, fast and cheap. Pick any two."
|
|
|
|
|
Ok, haven't read them yet but just noticed there are quite a few articles listed under Add-In's on the main page.
PS to webmaster (the search functionality could stand a tweak I think)
--Tony Archer
"I can build it good, fast and cheap. Pick any two."
|
|
|
|