|
Thanks for the tip Polis, but DataGridItem is for ASP.NET and I'm using WinForms.
If you can point me into another direction I'd really appreciate.
Best Regards,
Jose Guay
|
|
|
|
|
Oh I am sorry Jose.
It seems that for a reason I got the impression that u were dealing with ASP.NET. Anyways, even better. Have a look here[^] for your answer. In fact, have a look at the remaining part of that website. I am pretty sure that any other questions you might have regarding the DataGrid control have already been answered in there. It's an excellent resource.
Hope this helps.
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Can any one help me out how to write the code for addin in C# which creates a button on command bar and on click of that button entire document data shuld be saved to database.(not only word but this should work for every office application ppt,xls,doc..it shuld be generic to office applications)
text selection shuld be hidden from user how?
how to add customdocument property of an office application thru C#? this can be done i VB.NET but it has some issues with C# plz help me out
|
|
|
|
|
hi everyone i need to know how can i transfer the instant voice comes from the mic through the network to another client in chat Application any help with this ?
is there any one can help me with that option ?
Miss With The Best And Die Like The Rest
|
|
|
|
|
I'm writing a desktop security application which uses findwindow and showwindow API's to hide the desktop. The problem I have is if the user double clicks on the background the start menu appears. This also occurs if you set the policy value NoDesktop.
<br />
Hive: HKEY_CURRENT_USER<br />
Key: Software\Microsoft\Windows\CurrentVersion\Policies\Explorer<br />
Name: NoDesktop<br />
Type: REG_DWORD<br />
Value: 1<br />
Can anyone tell me how to stop the start menu from appearing?
Thanks in advance!
I reject your reality and substitute my own!
- Adam Savage, Mythbuster
- George W Bush
life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
|
|
|
|
|
I have a property grid which shows a set of properties of a Label the user selects. I can move the label around and resize. When the user changes one of the properties the PropertyValueChanged event handler is fired, and it sets a flag to true (I use this flag to check if the programs has to save the work on exit). However, when I resize or move the labels with the mouse the values of Location and Size in a property grid don't change, and the handler isn't fired.
The question - how to make the property grid show these changes?
|
|
|
|
|
You could try invalidating the PropertyGrid after the Label has been moved or resized. This might force the PropertyGrid to pick up the new values.
"I think I speak on behalf of everyone here when I say huh?" - Buffy
|
|
|
|
|
ok background. I've added buttons to a "navigation" user control...added this control to my form. How do I capture the controls Onclick events?
|
|
|
|
|
The control should capture the onclick events by itself. Where are you putting the control? Is it on a webform or winform? When I create a user control in a winform and click the buttons it responds as it should. What are you trying to do exactly?
-------------------------------------
Do not do what has already been done.
|
|
|
|
|
"Where are you putting the control?"
I drag and drop the control from "MyUserControls" on the toolbox to 'form1' or whatever.
"Is it on a webform or winform?"
It's a winform.
"What are you trying to do exactly?"
All I'm trying to do is make 'form1' respond to a click of a button on the control I added to the form.
So for instance....when you click the "personnel" button a label's text on 'form1' changes.
I'm trying to get a handle on where you put things.
Thank you!
|
|
|
|
|
If the button was in a user control so you must handle it's click event in the code of the user control itself.
|
|
|
|
|
Ok here's the statement I was missing....
the event handler I needed to add in the form was not just to the control, but to the control within the control.......I know it's a headache. Here's the statement
this.left_navigation1.linkLabel1.Click += new EventHandler(linkLabel1_Click);
Thats all I was missing....
Thanks all for you response!
|
|
|
|
|
The button exposes a Click event that you can subscribe to. From within the event handler for click, you can set the label's text to whatever you want. The code will look like
public class MainForm : Form
{
private Button button = new Button("Hai");
private Label label = new Label();
private void InitializeComponent()
{
button.Click += new ClickHandler(MainForm_buttonClick);
}
private void MainForm_ButtonClick(object sender, EventArgs e)
{
label.Text = "Bye";
}
}
Note that you don't need to write all the event wireup code, VS.NET does it for you. You only need to write code to set the label's text.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hello. I'd like to write a CAB extracting/packing application, and am looking for MSZIP/LZX implementations (no matter what programming language it/they is/are in) or format specifications.
Thank you, and regards,
Stan
|
|
|
|
|
Good day all.
I have a two column ListView. I am having problems getting my ListView to display text in the 2nd column after the first row. The first row works fine for both columns 1 and 2. When I write data the second time. Row 2 column 1 writes the data but column 2 does not.
I am trying to use Listview.Items[0].Add( "xxxx" ); to update the 2nd column.
Thank you in advacne for your assistance.
|
|
|
|
|
try ListView.Items[n].SubItems.Add("xxxx")
|
|
|
|
|
Hi,
I am new in devloping applications for communication between devices.
How can i do serial port communication on .NET platform using C#(.NET Framework 1.1).
Please, let me know some good articles/books to learn "how to communicate to devices".
Thanks for some help.
Subrahmanyam.
|
|
|
|
|
There are a number of articles here on CodeProject, use the search article above with the word "Serial".
Here's one to get you started: http://www.codeproject.com/dotnet/DotNetComPorts.asp[^]
Gary
Marc Clifton: "In other words, VB is like a bad parent. It can really screw up your childhood."
|
|
|
|
|
Hi
Could anybody offer advice as to how to periodically search all open windows for a window with a known text property then programmatically step through its controls entering stuff and finally firing a button click event.
Thanks
PL
|
|
|
|
|
I use the following code to do what you want to do. I have changed some names to protect the innocent, so where you values inside <>, just change it to reflect what you need.
Usage: Just copy and paste into a class file.
Good Luck!
<br />
using System;<br />
using System.Text;<br />
using System.Runtime.InteropServices;<br />
using System.Diagnostics;<br />
<br />
namespace APPLoginWindow<br />
{<br />
public class APPLogin<br />
{<br />
<br />
private object data;<br />
<br />
#region Contructor, dispose, main<br />
public APPLogin()<br />
{<br />
getAPPLogin();<br />
}<br />
#endregion<br />
<br />
#region win32 imports<br />
public delegate bool EnumWindowsCallback(int hwnd, int lParam);<br />
public delegate bool EnumThreadProc(IntPtr hWnd, IntPtr lParam);<br />
<br />
[DllImport("User32.dll")] public static extern int GetWindowText(int hwnd,StringBuilder lpString, uint bufferSize);<br />
<br />
[DllImport("User32.dll")] public static extern int EnumWindows (EnumWindowsCallback callback, int lParam);<br />
[DllImport("User32.dll")] public static extern int EnumChildWindows (int hWndParent, EnumWindowsCallback callback, int lParam);<br />
[DllImport("User32.dll")] public static extern bool EnumThreadWindows (uint threadId, EnumThreadProc pfnEnum, IntPtr lParam);<br />
<br />
[DllImport("User32.dll")] public static extern int RealGetWindowClass(int hWnd,StringBuilder pszType,uint bufferSize);<br />
[DllImport("User32.dll")] public static extern int SendMessage( int hwnd, int uMsg, int wParam, [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPStr)] string lParam);<br />
<br />
[DllImport("User32.dll") ] public static extern int FindWindow (string lpClassName,string WindowName);<br />
[DllImport("User32.dll") ] public static extern int FindWindowEx (int hWnd,int hWnd2,string lpsz,string lpsz2);<br />
[DllImport("User32.dll") ] public static extern int SetWindowText(int hWnd,string lpsz);<br />
#endregion<br />
<br />
#region Constants + fields<br />
public static int GW_HWNDNEXT = 2;<br />
public static int GW_CHILD = 5;<br />
public static int GW_OWNER = 4;<br />
public static int GWL_HWNDPARENT = -8;<br />
public static int WM_SETTEXT = 12;<br />
public const int HWND_MESSAGE = -3;<br />
public const int BM_CLICK = 0x00F5;
public const int WM_CHAR = 258;<br />
private string _windowText = "";<br />
#endregion<br />
<br />
#region Callback functions for listing windows<br />
private bool displayAPPLogin(int hWnd, int lParam)<br />
{<br />
StringBuilder windowName = new StringBuilder(255);<br />
StringBuilder className = new StringBuilder(255);<br />
<br />
GetWindowText(hWnd, windowName, 255);<br />
RealGetWindowClass(hWnd,className,255);<br />
if ( windowName.ToString().ToLower().IndexOf("<Name of Login Window>") != -1 )<br />
{<br />
data = hWnd;<br />
}<br />
<br />
return true;<br />
}<br />
<br />
#endregion<br />
<br />
#region Sendmessage clicks<br />
public void PerformAPPLogin()<br />
{<br />
int hWndAPPLogin;<br />
<br />
hWndAPPLogin = (int) data;<br />
<br />
if ( hWndAPPLogin != 0 )<br />
{<br />
int hWndAPPLoginUserName;<br />
int hWndAPPLoginPassWord;<br />
int hWndAPPLoginOKButton;<br />
<br />
hWndAPPLoginUserName = FindWindowEx(hWndAPPLogin,0,"Edit",null);
SendMessage(hWndAPPLoginUserName,WM_SETTEXT,0,"<UserName>");
hWndAPPLoginPassWord = FindWindowEx(hWndAPPLogin,hWndAPPLoginUserName,"Edit",null);
SendMessage(hWndAPPLoginPassWord,WM_SETTEXT,0,"<Password>");
hWndAPPLoginOKButton = FindWindowEx(hWndAPPLogin,0,"Button", null);
SendMessage(hWndAPPLoginOKButton,BM_CLICK,0,null);
}<br />
}<br />
<br />
#endregion<br />
<br />
#region Get APP Login Window<br />
private void getAPPLogin()<br />
{<br />
bool APPRunning = false;<br />
<br />
Process[] processes = Process.GetProcesses();<br />
for (int i=0;i <= processes.Length -1;i++)<br />
{<br />
if (processes[i].ProcessName.ToLower().IndexOf("<Name of Process>") != -1)<br />
{<br />
APPRunning = true;<br />
}<br />
}<br />
<br />
if ( APPRunning )<br />
{<br />
<br />
EnumWindowsCallback EnumWCB = new EnumWindowsCallback(displaySAPLogin);<br />
EnumWindows(EnumWCB ,0);<br />
<br />
}<br />
}<br />
<br />
#endregion<br />
<br />
}<br />
}<br />
I reject your reality and substitute my own!
- Adam Savage, Mythbuster
- George W Bush
life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
|
|
|
|
|
Hi to all.
My name is Bruno and I am an Italian programmer.
I've a problem.
I need to write a program that make a map for apply texture on a various images that contains object (ex. Sofa', chairs, dressed, ...) to change his color/textures.
I've founded software. Look at this:
http://www.nedgraphics-porini.com/Default.aspx?SiteID=7&PageID=166
I've marked 3 extremely hard phases.
1: create a map for curves and angles:
- Algorithm to draw a 3d curve with GDI (2D)
- Algorithm to transform create curve
- Save the curve for future visualization
2: Map texture to curve (texture mapping)
3: Overlay original image with textured map
For the third phase I've supposed to use the base pixel brightness and draw the texture pixel with the same brightness.
The result is ok but work fine just with flat colors because if I use a texture this is so flat.
Therefore I need texture mapping.
Have you a line guide for me?
I've considered using Ray Casting technique or quite DirectX/OpenGL
Tanks for your time.
Bruno
Sorry for terrible English
|
|
|
|
|
|
I need control (.net or ActiveX) to draw 3d graphs in my application... What can you suggest?
|
|
|
|
|
hi all,
i'm trying converting numbers to alpha. for example if i write 30 it'll give me "thirty" or 31 - "thirtyone"... how can i do that?? thanx...
|
|
|
|
|
Wow, that would not be too hard but would require more time to explain than I think most of us would be willing to put in, but if it's okay, let me get you started and I think you can figure the rest out on your own.
seperate your problem into periods. A period is the three number grouping deliniating hundreds, thousands, millions .... ie 42,233,123 so this should convert to the string "fouty two million, two hundred thirty three thousand, one hundred twenty three" right?
so now you have three strings : "42" , "233", "123"
now take each of those strings and make a post-period-word for them to tack on later, so you'd have: "Million", "Thousand" Dont worry about the last string, that one will just be worded on its own.
now convert the number in each of the strings and convert them into words. You can figure this out on your own and its not too hard but think carefully about it, there are some special cases here!
This is kind of a recursive algorithm but there are a few special cases you'll need to code for like
not wording the last group. For instance you would not want to save "One Hundred Twenty Three Hundred".
Have fun.
|
|
|
|