|
If you want help, be specific. Why is it not working? Are you geting an exception? What exception type are you getting? What message does it contain?
Code similar to what you have is not only recommended in the .NET Framework SDK, but has worked for me and others in the past. More information would be helpful to help you solve your problem.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for you interest. I would have been happier if an excpetion was thrown...there are no exceptions thrown, it just simply doesn't work. The text that was entered in to the current cell was not updated to the database. All other cells with modified text were updated correctly. If I modify the text, click on another cell and then close, the text updates properly it is only when I have not left the current cell that I have the problem. When you have had this work, was it in the 'Closing' event of the form? is there a better place to do this processing?
thanks
|
|
|
|
|
Does DataGrid.CurrentCell return anything? Also, in DataGridColumnStyle.EndEdit , just use DataGridCell.RowNumber instead of DataGridCell.CurrentRowIndex . The number of internal instructions is a little less, giving you a small increase in performance.
The Closing event is a good place to do this, although if you're doing this in the Form that contains your DataGrid , don't handle the Closing event; simply override OnClosing :
protected override void OnClosing(CancelEventArgs e)
{
base.OnClosing(e);
} This results in much faster code, since the IL instruction callvirt is used instead of many calls to a MulticastDelegate , enumeration of the delegates (handlers), and invocation of the handlers. Overriding the event handler also gives you a little more control. While you should typically call the base class's method, there are some times you might not want to (like not calling base.WndProc for a particular method in order to surpress it from being handled at all).
Note that with control events, if you don't call the method on the base class, the event will not be fired so any other handlers won't be invoked.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
yes, DataGrid.CurrentCell has the proper values in it. I will try your other suggestions - thank you!
|
|
|
|
|
plz help me out here dods..,
i wanna example a simple one please to connect to other pc in the local area network and perform operation like loging off or killing process that will help me alot
ADEL K Khalil
|
|
|
|
|
Uh, basically your going to need...
1. A server app for the remote computer
2. A client app for you
And that's it.
The server will sit on the remote computer listening for for requests on the specified port. This is done with the TcpListener.[^]
Then client app will be on your compter and will use the TcpClient class[^] and take the ip address of the server app and the port in the Connect method.
It's pretty simple. Uh, I think the best way is to look at examples here and on msdn. And, also for the server functions like logging off you can use the API ExitWindowsEx[^]. Uh.... and there are .net classes like Process for killing apps and stuff...
yeah.... SO here's the overview. Make the server and the client. Start the server on the remote machine and start it listening for incoming connections. then start your client then say... You have some preconfigurations in your server code that says if the incoming message says "logoff" then your server will run the ExitWindowsEx method. So, with your client enter the name/ip of your remote computer and then send "logoff" to the server then your remote comp. will logoff. there. done.
I hope my links work. Remember, theres lots or examples here and msdn.
/\ |_ E X E GG
|
|
|
|
|
thanks that help me alot
ADEL K Khalil
|
|
|
|
|
RealVNC.COM (free, easy, works).
|
|
|
|
|
This easiest way is to use the WSH and vbscript. Here is a quick sample
<br />
'strCompName = "." 'This is for the local host<br />
strCompName = "computer name" ' ip address may work as well<br />
Set objWMIService = GetObject("winmgmts:" _<br />
& "{impersonationLevel=impersonate}!\\" & strCompName & "\root\cimv2")<br />
Set colProcessList = objWMIService.ExecQuery _<br />
("Select * from Win32_Process Where Name = 'Notepad.exe'")<br />
For Each objProcess in colProcessList<br />
objProcess.Terminate()<br />
Next<br />
Save the code above as stopnotepad.vbs and call it from the commandline with cscript stopnotepad.vbs
You may want to check out the MSDN section on scripting, particullarly the scripting clinic and scripting guys.
|
|
|
|
|
Well, code project is great for my .NET resources.
I'm looking for a forum just as great as this, but for Java programming.
Any recommendation?
Thanks
|
|
|
|
|
http://forum.java.sun.com/
is pretty responsive, but people there seem to be a little more uptight and they tend to poke at you if you ask simple questions.
|
|
|
|
|
I use a TextBox to edit data in ListView(From a MSDN Article),but the TextBox height biger than listview ,that looks very urgly,how to make the height of ListView row equals with height of TextBox ?
|
|
|
|
|
If you use imagelist for your ListView, then you can force higher line height by having your images as large as needed.
It's a stupid workaround, but it works for me.
|
|
|
|
|
I'm trying to print a report created with Report Services, but I don't understand how it is devided into pages (ex 1/3) and how I can print all the pages, not only what fits into the first print page! it is possible to resize some how what I need to print?
//Report printing code
SHDocVw.OLECMDEXECOPT doOpt;
object o = new object();
doOpt = SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_PROMPTUSER;
axWebBrowser1.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINT , doOpt, ref o, ref o);
Thanks!!!
|
|
|
|
|
You're not making any sense. Using the IOleCommandTarget implementation - as you're doing - invokes the printing functionality in Internet Exporer, which - last time I checked - prints all pages unless the user specifies a range. Since you're specifying OLECMDEXECOPT_PROMPTUSER , they should be seeing this dialog.
So what exactly are you trying to do?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am making an app where you can click on an image (in a picturebox) to get X, Y, Width, and Height values. I would like to make it draw a rectangle of the specifyed X Y Width Height values on the PictureBox/Form once selected. Is this possible?
Help is much appreciated,
~ZeldaFreak
|
|
|
|
|
You could always add code in the OnPaint event. If you just want to draw a single rectangle just declare a rectangle on the form object, then using mouse events once it is selected set the Selection Rectangle object to the appropriate values and then call this.Invalidate(); It will force a repaint of the object. Inside the paint routine you can have code to only bother drawing the rectangle if a selection has been made.
The actual drawing of the rectangle can be done via the System.Windows.Forms.PaintEventArgs object which is passed to the routine. Simply use the e.Graphics.DrawRectangle(); method to draw the actual rectangle. An example of this called would be:
e.Graphics.DrawRectangle(new Pen(Color.Red, 1), x, y, mySelection.Width, mySelection.Height);
I am sure there is a better way out there but this should work.
|
|
|
|
|
Hi,
short question. What control can I use to display html pages in my winforms app. Just a starting point needed.
Thanks in advance,
Matthias
If eell I ,nust draw to your atenttion to het fakt that I can splel perfrectly well - i;ts my typeying that sukcs.
(Lounge/David Wulff)
www.emvoid.de
|
|
|
|
|
In the toolbox, right click and select the function for adding new controls.
In the selector window, click on the COM tab.
Scroll to bottom and choose Web Browser.
Drag and drop that to your form or container control.
You may also want to look at the articles on other fun things you can do with that control. (NOTE: I use the word fun with tongue in cheek)
In the main menu get into the C# menu for articles.
Choose the COM Interop selection.
Nick and I have two good articles to read. You are quite likely to need either process or both at some point in time.
______________________________
The Tao gave birth to machine language.
Machine language gave birth to the assembler.
The assembler gave birth to ten thousand languages.
Each language has its purpose, however humble.
Each language expresses the Yin and Yang of software.
Each language has its place within the Tao.
Beauty exists because we give a name to C#.
Bad exists because we give a name to COBOL.
|
|
|
|
|
Hi,
thanks for your reply. Since I'm not using Visual Studio, I can't simply follow your steps. So I thought, good thing would be to use the tool tlbimp.exe (SDK) to get an assembly from the mshtml.dll typelib, located in the Winnt\System32 folder. But tlbimp keeps telling me, that it is not a valid typelib.
Can you tell me how I can create the appropriate assemblies using tlbimp or aximp so that I can use them eventhough I don't have Visual Studio installed?
Thanks in advance!
Matthias
If eell I ,nust draw to your atenttion to het fakt that I can splel perfrectly well - i;ts my typeying that sukcs.
(Lounge/David Wulff)
www.emvoid.de
|
|
|
|
|
I think you should be able to, but you will have a very hard time constructing this without VS!!!
______________________________
The Tao gave birth to machine language.
Machine language gave birth to the assembler.
The assembler gave birth to ten thousand languages.
Each language has its purpose, however humble.
Each language expresses the Yin and Yang of software.
Each language has its place within the Tao.
Beauty exists because we give a name to C#.
Bad exists because we give a name to COBOL.
|
|
|
|
|
HI!
I am currently at the beginning of a new project and I would like to start
with something out of the box. As we started our Web project we used IBuySpy Portal
and it worked fine because we did not waste our time on authentification,
authorisation and all that but we were able to start right with the logic
of the application. Is there something like that for SmartClient? I mean template
solution containing the newest application blocks of Microsoft?
Any comments or help will be highly appreciated.
gicio
|
|
|
|
|
As I understand it, the Application Blocks are basically large 'patterns' for deployment. So if you find an Application Block that provides the SmartClient pattern, then that is where you would begin.
______________________________
The Tao gave birth to machine language.
Machine language gave birth to the assembler.
The assembler gave birth to ten thousand languages.
Each language has its purpose, however humble.
Each language expresses the Yin and Yang of software.
Each language has its place within the Tao.
Beauty exists because we give a name to C#.
Bad exists because we give a name to COBOL.
|
|
|
|
|
I did a windows usercontrol,then I put it in my web appliation.Others client run this web application to http.But, a thing was happened,because I use a localhost's filepath, but,there was not on others client.So,at run time, error was happened. I wanted to know, if web application had windows usercontrol then run my web application on others client, which resource was be used windows usercontrol.
|
|
|
|
|
Your question doesn't make ANY sense whatsoever.
jzb wrote:
I did a windows usercontrol
You created a Windows Forms User Control? Or did you create a Web User Control?
jzb wrote:
because I use a localhost's filepath, but,there was not on others client.
Localhost's FilePath for what? You should NOT be using client FilePaths for anything since, inside a web browser, access to the clients FileSystem is forbidden for security reasons.
jzb wrote:
which resource was be used windows usercontrol.
What? Are you asking what resources a control has access to on the client side? The FileSystem on the client machine is NOT accessible from within a web browser.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|