|
why is a TopMost Form on top of all open windows in the system, instead of
being on top of only its application windows?
man
manson
|
|
|
|
|
It's a windows style. Not necessarily unique to the .net framework. Topmost means that the window won't be covered by any other windows. Check the win32 api for more info.
|
|
|
|
|
If you want a form to always be on top of a particular Form, you can set the Owner property on the form that should appear on top to the one that should appear below. Alternatively you can call AddOwnedForm(ownedForm) to do the same.
ie, FormA should always be on top of FormB
FormB.AddOwnedForm(FormA);
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
James T. Johnson wrote:
, FormA should always be on top of FormB
Cool I didn't know that.
C# is fundamentally broken. - Christian Graus
|
|
|
|
|
James T. Johnson, you are the man! ;]
thank you
i already thought i was gonna decent to win32 api to do that..
i surely reviewd all Form members a time or two, but somehow i didnt pay much attention to the Owner property, shame on me
manson
|
|
|
|
|
I have my datagrid. User's entering data. Everyone's happy. UNTIL... I want to save my datagrid's data!
In general, upon RowChanged events, all the data is put into a proprietary data format within a class (for simplification, pretend it's a linked list for now). I save my data by looping through each node in this linked list.
However, if the user is in the middle of entering or editing a row when they want to save their data, that row was never entered into my linked list, because RowChanged was never called for that Row. And the worst part is, if the row is being added (as opposed to being edited), that row is not in myDataTable.Rows either. So when I want to save, the row the user is on is never saved.
My idea for a solution was to trigger a rowchanged event for this row. But this turns out to be rather hard, because that row does not exist anywhere! The only place I can find that row is within a rowchanged event.
So to get around this, I was thinking the only way to fix this would be to use a hack, and try to make the datagrid think the user had pressed the down key. Unfortunately, I cannot figure this out! Help? How can I send a keydown message, either globally, or to my app, or (best of all I suppose), just to my DataGrid?
Or, does someone else know a way to effectively tell the datagrid, "do a rowchanged event on the row you are currently focused on!" Starting of the chain of events which puts that row in my linked list, which gets saved to a file.
(Why are my questions always so lengthy? Is that a good thing, or a bad one?)
Alright, I'm done now.
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
Have you tried
dataGrid1.Select(-1);
before you call the save method?
David Stone
It seemed similar to someone saying, "Would you like to meet my knife collection?"
Ryan Johnston on Elaine's sig
|
|
|
|
|
Hi all!
I just got 2 questions:
1. How can I make those kind of dockable and resizable tool windows which you have Visual Studio .NET (like the Solution Explorer, Tool-Window or Properties-Window). Is there a special control oder form which I could use? Or does anybody know where I could download such a control?
2. I got a form which has a treeview docked on the left hand side. I use a splitter, to make that treeview resizable. On the right side, I want to display different input-masks, depending on the selected node in the treeview. Whats an easy way to do that? I want to be able to design those masks during design-time and not run-time. I would need some kind of the java cardlayout or some kind of tab-control, but just without visible tabs.
I hope anybody can help me!
so long...
Mario
|
|
|
|
|
Anonymous wrote:
Or does anybody know where I could download such a control?
http://www.crownwood.net/ [^]
I suggest their VS.NET menus as well!
Can't help with #2 though, sorry.
-Domenic Denicola- [CPUA 0x1337]
MadHamster Creations
"I was born human. But this was an accident of fate - a condition merely of time and place. I believe it's something we have the power to change..."
|
|
|
|
|
Thx for your help
so long...
Mario
|
|
|
|
|
Can anyone convert the following vb6 code to c#?
Dim SW As SHDocVw.ShellWindows
Dim IE As SHDocVW.InternetExplorer
Set SW = New ShellWindows
For Each IE In SW
If TypeOf IE.Document Is HTMLDocument Then
Debug.Print IE.hWnd
End If
Next IE
The problem lies in the line "For Each IE In SW" since VB supports typeless variables and C# is typed.
|
|
|
|
|
I don't know if every object in SW is of type InternetExplorer or not. I assume it is not.
Use COM Interop or something like that to get all the SHDocVW objects into the .NET system. Then this should work (not sure about the class names):
<br />
ShellWindows SW = new ShellWindows();<br />
InternetExplorer IE;<br />
foreach (object o in SW)<br />
{<br />
IE = o as InternetExplorer;<br />
if (IE.Document is HTMLDocument) Debug.WriteLine (IE.hWnd);<br />
}<br />
<br />
Hope this helps.
|
|
|
|
|
:(I have a datagrid that I populate from a dataset. When I click on a row, I can use the clicked row to access the data in that row using the dataGrid1.CurrentCell.Rownumber with the following code:
object freq = ds.Tables[0].Rows[dataGrid1.CurrentCell.RowNumber][1];
and all works fine. After I click on a column heading to sort the dataset, and then click in a row, the row number returned is the correct new row, but the Table is not resynced, and I get the data that was at that row in the unsorted table. The following code should fix the problem (maybe):
dataGrid1.DataBind();
but this only works in a web form. I also tried rebinding as follows, but no joy:
dataGrid1.SetDataBinding(ds, "Stations");
Can anyone help?
Thanks, Barry k4mg@arrl.net
|
|
|
|
|
Hi all,
I'm new on C# and I get quite many problems.
One of them is how to register hotkeys with C#.
I entered this line in my class declaration :
[DllImport("user32.dll")] private static extern bool RegisterHotKey(long hWnd, int id, int fsModifiers, int vk);
when I run this line whatever the letter is, it doesn't work and return me false.
bool b = RegisterHotKey(GetForegroundWindow(),100,2, 'J'); // 2 = VK_CONTROL
Please help, thanks all.
Nd.
For those who could get it working, don't forget to unregister your hotkey : bool UnregisterHotKey(long hWnd, int id);
|
|
|
|
|
Anonymous wrote:
bool b = RegisterHotKey(GetForegroundWindow(),100,2, 'J'); // 2 = VK_CONTROL
Im not sure, but that 'J' bit needs to be the VK int defined in the headers, you cant assume (int) 'J' will be the correct value.
Hope this helps
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Thanks leppie for your help, I got the value of VK_J (an example) on the web, it's 0x4A. (My C# doesn't know any constant API variable)
But it doesn't work anyway.
If you need as me the numerical equivalent as WM_TIMER or VK_UP, ... go to :
http://www.vbtt.com/tips/how_to_set_or_query_the_status_of_the_keyboard.html
Nd.
|
|
|
|
|
Hi all
How do i define structs in C# from their definitions in the header files?
I have scratched C++, but not enough.
I understand most of it except for the following few:
1. How do i get the Layout and its options?
2. What is the equivalent of DWORD, WORD, LCID, etc...
3. How do i calculate the size of the struct? sizeof()?
4. What does the follow do and how/when do i know to define it? [MarshalAs(UnmanagedType.ByValTStr, SizeConst=80)]
Sorry for the lame questions
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
|
1. I'm not sure what you're asking. By default, structs in C# have sequential layout. You can go to Explicit layout if you need to control offsets exactly, using the StructLayout attribute.
2. DWORD = int, WORD = short. For others, you'll need to trace through the windows headers to find out how they're defined, and translate to the appropriate type. Handles should be typed as IntPtr.
3. In general, you should rarely need it. If you care about the size after it's marshalled into the unmanaged work, use Marshal.Size() (or is is SizeOf()?)
4. It says that the following string or StringBuilder should be marshalled as an embedded TCHAR array 80 characters wide. Use this when you see something like:
TCHAR value[80];
For other questions, it usually much easier to post the API you're trying to call and what your definition is
|
|
|
|
|
|
but i couldnot get
System.Configuration.dll
System.Diagnostic.dll
how to get it ?
can any body help?
r00d0034@yahoo.com
|
|
|
|
|
You will need to reference them in your project, by default only corlib and System get referenced.
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
i refrence them but error found because they are not in their exact location?
r00d0034@yahoo.com
|
|
|
|
|
imran_rafique wrote:
i refrence them but error found because they are not in their exact location?
What do u mean the exact location?
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
because how will i add their refrences if i dont have or they are not available from net framework?
what to do?
if there is an error in a program that need it?
r00d0034@yahoo.com
|
|
|
|