|
I am not familiar with any free software that does this but you might be able to find something. Are you looking to have the data replicated immediately as it is changed?
|
|
|
|
|
Hello,
Usually when I drop some controls at the MDI Parent and later open Mdi Child forms, I can see MDI Parent controls on the top of child forms. Is there any way that we can display Child forms without displaying MDI Parent controls. I know that SetWindowPos can make a child form topmost. but It'll be on the top of all other forms too which is not a good solution to the problem.
Any suggestions in this regard will be appreciated.
TIA
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net
|
|
|
|
|
Try setting Visible property to False on the controls on the MDI parent form at the time of displaying a particular child form (when you do not want to display them alongwith the child form).
|
|
|
|
|
Hello,
Not feasible. Suppose a Groupbox is placed at the MDI Parent with some child controls. MDI child form covers a part of the groupbox and its contained controls. How can this solution help in this regard
thanks for the response anyways.
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net
|
|
|
|
|
The probelm mentioned by you arises because you are perhaps trying to put some controls on the client area of parent form, instead of putting the same on the non-client area. The child form which would occupy the client area will naturally cover the client area, which inter alia means that the controls on the parent form (which are in the client area) are also covered at least partially. One thing is sure that if you put some controls on the non-client are of parent form, then the child form will not cover them.
But, the big question is why do you need to put some controls in client area of the parent form, when in the same area you have to show the child form? Why can't you put these controls on the non-client area of the parent form?
If there is some compelling reason for you to put the said controls in client area of the parent form itself, then these are the available options:
1. Make the application Single Form instead of MDI. Here, you'll have the option of showing other forms as independent forms called from the main form (though now they will not be the child forms, i.e., they will not be covered only in the client area of the main form; and plus some other pros and cons). So your child form functionality can be achieved through such other independent forms.
2. Second option is to have MDI format itself and put the controls in the client are of the parent form itself, if you don't have any other options. But, now try to limit the size of the child form in such a manner that the child form opens in the other part of the client are of parent form which does not have the parent controls. And, keep the size and location of the child form under your strict control in the code (e.g., non-flexible such as non-maximizable or fixed-single borderstyle property or subject to some co-ordinate limits by checking in code etc.) This will ensure that the parent controls are not hidden by the child form.
3. The third option is to make the Visible property of parent controls false if it is feasible, as I suggested earlier.
4. The best solution would of course be NOT to put the controls in the client area of the parent form.
Regards
|
|
|
|
|
try this
make a new form and place the controls on it. and in MDI
change the inherit statment of MDI Class to this newly added form containing controls and see if this you need to do
cheers........
|
|
|
|
|
I have got my main form working OK now, but it's still the case that my form spawns another form, using ShowDialog, all buttons have a DialogResult of none, the AcceptButon and CancelButton are none in both dialogs, but when you click a button in the second, and my code calls this.Close(), the parent dialog closes also unless I put hacky bool variables in to stop it.
Why, why, why ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Please check whether you have put the this.Close() method call in the first form (i.e., parent form itself)instead of putting it in the click handler of the second form. If this is so, please put that code in the click handler of the button in the second form.
In fact, I tried to test it using a chain of three forms, Form1 calling Form2, and Form2 calling Form3. I have also put this.Close() in both Form2 and Form3 click handlers for the respective buttons. But I get the correct and expected behaviour and the parent form is not closed. Apparently, your problem is because of this.Close() being called from within a method in the parent form itself.
|
|
|
|
|
Ashok Dhamija wrote:
this.Close() being called from within a method in the parent form itself.
No, it's not. I've stepped through many times and verifed that it's not.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
May I suggest the following scheme, as I tested it in my test application:
In Form1, I put the following code for button1 to display Form2 as a modal dialog:
private void button1_Click(object sender, System.EventArgs e)
{
Form2 form2 = new Form2();
form2.ShowDialog();
}
Then, in Form2, I put 2 buttons, button1 (to display Form3 as a modal dialog) and button2 (to close Form2), with the following code:
private void button1_Click(object sender, System.EventArgs e)
{
Form3 form3 = new Form3();
form3.ShowDialog();
}
private void button2_Click(object sender, System.EventArgs e)
{
this.Close();
}
I have put button1 in Form3, with the code to close it as under:
private void button1_Click(object sender, System.EventArgs e)
{
this.Close();
}
Now, when I show Form2 and then Form3 as modal dialog boxes from buttons in Form1 and Form2 respectively, they are properly shown. Similarly, when I close Form3 by clicking button1 on it (which uses this.Close() method and of course it can contain other code before that), it closes properly, and the important thing is that Form2 (which is the parent form for Form3) is NOT closed in this manner. Likewise, when I close Form2 by clicking button2 on it by using this.Close() method, Form2 closes properly and again it is pertinent to note that the parent form Form1 is not closed.
So, in this manner, the whole behaviour is as expected and correct. The only important aspect to note is that:
1. I am using the simple form2.ShowDialog() method, without using the DialogResult. Secondly, the actual functionality is added on the dialog form itself in its various buttons (instead of putting the same directly in parent form in the format of if(dialogResult == DialogResult.OK), etc.).
I wonder whether your application can be suitably modified to this pattern.
I really do not know whether all this is of any use to you.
Regards,
|
|
|
|
|
Hi - this is pretty close to what I am doing. I suspect that my form has some code that the designer has failed to remove, which is causing this behaviour.
Thanks for helping.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
A little code will help to know the exact situation.
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net
|
|
|
|
|
There is no code. No code that's relevant anyhow. The core issue is the values of the buttons, which are set in the designer.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Just a wild guess, but do your OK and Cancel buttons have their DialogResult property set to DialogResult.OK and DialogResult.Cancel?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
S. Senthil Kumar wrote:
Just a wild guess, but do your OK and Cancel buttons have their DialogResult property set to DialogResult.OK and DialogResult.Cancel?
No, sorry, I thought I said that. They are all set to (none).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi could u please tell me how i can check my sql database to look for a stored procedure if exist or not, and if not exist how i can create it, please help me by code, i have to finish my project as soon as possible
Thanks alot
Hamody
|
|
|
|
|
Surely this should have gone in the SQL / ADO.NET forum.
The SQL code is:
IF NOT EXISTS (SELECT * FROM dbo.sysobjects
WHERE id = OBJECT_ID(N'[dbo].[StoredProcedureName]')
AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
CREATE PROCEDURE ....
If you need to run this through a C# application just ExecuteNonQuery() on the SqlCommand like this:
SqlCommand cmd = new SqlCommand(sqlStatement, myConnection);
cmd.ExecuteNonQuery(); The above assumes that you already have a connection and it is open. The sqlStatement is a string that contains the completed contents of the SQL code above.
Does this help?
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
ok thnaks, i found another way to check the existance of the procedure thw procedure id:
proc dbo.Showhierarchy
(
@index int
)
As
Begin
declare @FolderIndex int, @FolderName varchar(30)
set @FolderName = (select Name from pdbfolder where FolderIndex= @Index)
print replicate ('_', @@nestlevel *4) + @FolderName
set @FolderIndex = (select min(FolderIndex) from pdbfolder where parentfolderindex = @index)
while @FolderIndex is not null
begin
exec Showhierarchy @FolderIndex
set @FolderIndex = (select min (FolderIndex) from pdbfolder
where parentfolderindex =@index and FolderIndex > @FolderIndex)
End
End
....
so in the create satement that u emailed i write the above proc as it, and i need to get the two values which is printed @FolderIndex, @FolderName
note that it is a recurcive proc
could u send me the correctes code
Thanks alot
Hamody
|
|
|
|
|
Really, you should be creating stored procedures in advance of running your application - unless it is some sort of installation applicataion.
You are not going to get any data out of this in a C# application because there are no SELECT statements that return data out of the stored procedure. The only time you get print statements back is if an error occurs and the contents of any print statements is captured in the SqlException.
Anyway, to run a stored procedure this is the code you need in C#
SqlCommand cmd = new SqlCommand("Showhierarchy", myConnection);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@index", indexValue);
cmd.ExecuteReader();
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
ok, when u execute it in the query analyzer u get a printed results i need them to be used in my code.
i don't know i think about inserting them in a table but the insert statement didn't execute in the proc that i sent to u ...
i don't know how to get these printed data ...
have u any idea
Thanks alot
Hamody
|
|
|
|
|
Hi
I have two projects and one of the project have internal methods which should be used in another project.. so i used friend assemly concept and was able to solve the problem partially... my problem is one of my projects have other refernced assemblies (third party also..) for which i dont have the code, which are not signed with a strong name. Now inorder to complete the process i have to sign the referenced assemblies as well.. How do i do that? Plz Help...
Regards
Deepak.S
|
|
|
|
|
If the assemblies have been delay signed then you can do it using the Strong Name Tool.
e.g.
sn.exe -R thirdparty.dll myKey.snk
|
|
|
|
|
|
I'm having a VERY hard time finding material I can read to understand this stuff. So far I got a program to evaluate mathematical equations and a basic Lexer that splits a string simply into a stack like so...
Example string - FunctionName ( "Param1" );
Stack[5]SEMICOLON
Stack[4]CLOSE_PAREN
Stack[3]"Param1"
Stack[2]OPEN_PAREN
Stack[1]FunctionName
Basically it tells me when it hits a special character, and after that it tells me what's inside it. I'm having a really hard time explaining this, a bunch of source is available here:
www.insolence9.com/downloads/SBN.zip
Thanks
|
|
|
|
|
Hi all
i need a bit help in saving images into mysql database through my C#.net application.I had converted the image into byte array but when i insert it or update the feild by an insert or update statement exception is thrown.
can anyone guide me pls
Thanks
Monica
|
|
|
|