|
The easiest way IMO to change between two forms where the main one closes and a new one opens, is to make both forms controls and show them both ( only one at a time ) on the main form.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Sorry, I'm not explaining right. The main Form1 can launch multiple Form2's in response to user-action and all the forms remain open. If the user subsequently decides to close Form1, I don't want all the little Form2's to close also.
|
|
|
|
|
Alex4thDegree wrote: and all the forms remain open.
Chris's reply is correct. Without very specific requirements for this type of behavior a MDI UI would be called for in your case. The MDI interface clearly signifies that the child windows will all exit when the main window is closed. You can still prompt the user with a warning, once again if requirements call for it.
led mike
|
|
|
|
|
I've used MDI UI's in the past, and that isn't what I want. I already have a warning dialog now, but I want to get rid of it because it is inelegant.
Are you guys telling me this is impossible? I can't believe this. I have seen other software that does this kind of thing. Maybe it is just complicated to implement - or incompatible with using VS designer - and not commonly done, but surely there is information on this somewhere? I'll keep looking, if I find anything I'll post it here.
|
|
|
|
|
Alex4thDegree wrote: Are you guys telling me this is impossible?
What? I never said that.
Alex4thDegree wrote: I already have a warning dialog now, but I want to get rid of it because it is inelegant.
but popping up endless top level dialogs isn't?
And you can close the main window without exiting the application, so how do they exit the application, some sort of mystical chant or dance involved?
I hope you have a captive audience because I would uninstall that pile of dung faster than you could spin in your chair.
Abandon hope all ye who answer here.
Pete O'Hanlon - the General Discussions forum
|
|
|
|
|
Hello all. I created an Icon and embedded it in my Resource file. I've been able to get the cursor with the following:
using (MemoryStream resStream = new MemoryStream(SpatialLib.Properties.Resources.MapTipCur, false))<br />
{<br />
this.MapControl.Cursor = new Cursor(resStream);<br />
}
Now, this successfully loads the cursor but there a huge problem...the cursor is all black. Not the original color. Has anyone gotten around this?
Thanks in advance,
Lester
http://www.lestersconyers.com
modified on Monday, March 10, 2008 4:31 PM
|
|
|
|
|
If it's a black box, then it must not be loading correctly.
lsconyer wrote: using (MemoryStream resStream = new MemoryStream(SpatialLib.Properties.Resources.MapTipCur, false))
{
this.MapControl.Cursor = new Cursor(GetType(), "MapTipCur.cur");
}
I don't see how this would work, you never use the MemoryStream, so why create it ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Sorry about that. I posted the wrong code sample. I just edited and changed the code.
The cursor is not just a black box, though. It's the correct shape as my cursor but its just filled in black. I think it's a problem with the stream converting the byte[] into an image then to a cursor. I cannot get around it.
Lester
http://www.lestersconyers.com
|
|
|
|
|
OK - there are two special colors in a cursor, are you using one of them ? Perhaps you've marked a transparent area, and that's what's failing to load properly ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
used DBS: <oracle>
Hello,
i just wanna ask,if somebody successfully combined an Array with UDT as fields for an OUTPUT-Parameter
of an Oracle StoredProcedure.
the Proc-declaration and the Arraydefinition could be look like that:
type custom_TBL is table of custom index by pls_integer; --> custom is the UDT
procedure test(p_customList OUT custom_TBL)
This would be an combination of the techniques in this two drafts:
http://www.c-sharpcorner.com/UploadFile/...erfor.NET6.aspx
http://forums.oracle.com/forums/thread.j...86484&tstart=30
regards
faehne
|
|
|
|
|
I have a problem with referenced assemblies not getting compiled into their bin\debug folder. I don't remember this being an issue before and I do not get compiler errors. Granted this is not a simple set of references. I'll explain:
1) I have two solutions (1 and 2).
2) There are four projects involved (A-D).
3) Project A and B are in solution 1 and projects C and D are located in solution 2.
- Project A references B in solution 1.
- B references C between solutions 1 and 2.
- Finally C references D in solution 2.
4) In the bin\debug folder of project B I have the directly referenced project C and the sub-referenced D.
5) In the bin\debug folder of project A I have the directly referenced project B and the sub-referenced project C BUT NOT ITS SUB-REFERENCED PROJECT D!!!
Why? And why is this a new issue for me??? I didn't notice this until I wanted a clean build and wiped out the bin\debug folder of project A.
|
|
|
|
|
Ok. This is potentially not a new issue for me. Were were copying assemblies over from the other solution for other reasons so perhaps I had been copying in the missing assembly all along. This still does not explain why project B has the correct list of DLL's but project A doesn't. Any ideas anywone?
|
|
|
|
|
Something else that I just noticed. Project A is missing the pdb file for project C in the bin\debug where its sub-assemblies referenced are missing. Project B in the same solution (1) has the pdb file for project C. Does that matter?
|
|
|
|
|
ISSUE SOLVED!!!
I took a look at the "Object Browser" and some of my external references to solution 2 in solution 1 had version numbers next to them. We have had problems with assembly references getting "Specific Version" set to TRUE on them. We had corrected those manually through the properties of the references but it seems that some of them, though correct, needed to be removed and re-added to fully correct them. It seems to be a bug in VS2005 sp1. Hopefully this helps others with the same issue before it gets buried!!!
|
|
|
|
|
I have code that walks through the properties of an object and writes out the property name and value in UTF-16 format.
One of the fields has a string date and time formatted as follows: yyyy-MM-ddThh:mm:ss
When I step through the code, the data sent to my writer is formatted correctly.
When I look at the output, however, it is now: yyyy-MM-dd hh:mm:ss AM.
I know that it is not my writer logic doing this because it always just works with the object.ToString() method on everything.
The base type of this object is string, not DateTime.
First of all I cannot believe that StreamWriter is reformatting the data.
Secondly I need to have it kept in the original format.
Any suggestions to tell StreamWriter to keep its' hands off my data would be appreciated.
|
|
|
|
|
I think we need to see the code, I doubt very much that a streamwriter would reformat a datetime.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian,
Trust me, I've been saying the same thing myself. Below is the code. I commented the line where I verified the format was still dateTtime and then looked at the output that was put to the file in notepad to see that the format was now data time AM. Messed up my head something fierce.
public sealed class Serialize:IDisposable
{
static StreamWriter output;
public static void WriteOpen(string fieldName)
{
string buffer = String.Format("<{0}>", fieldName);
output.Write( buffer );
}
public static void WriteClose(string fieldName)
{
string buffer = String.Format("</{0}>", fieldName);
output.Write( buffer );
}
public static void WriteRaw(string rawData)
{
output.Write( rawData );
}
public static void WriteLine(string fieldName, string value)
{
if (value.Length.Equals(0))
{
string buffer = String.Format("<{0} />", fieldName);
output.Write( buffer );
}
else
{
string buffer = String.Format("<{0}>{1}</{0}>", fieldName, value);
output.Write( buffer );
}
}
public static void OutputXmlStream(FileStream stream, Object value)
{
output = stream;
string buffer = "<?xml version=\"1.0\" encoding=\"UTF-16\" ?>";
output.Write(Encoding.UTF8.GetBytes(buffer),0,buffer.Length);
Type baseObjectType = value.GetType();
WriteOpen(value.GetType().Name);
PropertyInfo[] propertyList = baseObjectType.GetProperties();
foreach (PropertyInfo embeddedProperty in propertyList)
{
if (embeddedProperty.DeclaringType.ToString().StartsWith("SourceOne"))
ObjectWalker.Walk(embeddedProperty.GetValue(value, null));
else if (embeddedProperty.GetValue(value, null) is ArrayList)
IEnumerableWalker.Walk( (ArrayList)embeddedProperty.GetValue(value, null));
}
WriteClose(value.GetType().Name);
}
#region IDisposable Members
public void Dispose()
{
Dispose(true);
}
internal void Dispose(bool disposing)
{
if (disposing)
{
}
GC.SuppressFinalize(this);
}
#endregion
}
|
|
|
|
|
hey guys, just noticed something seriously odd. when (some) of my apps are ran on another machine, they crash with a kernel32.dll problem. everything works fine on my development machine (vs 2008), some run fine on another machine, and some just refuse to. ive tried playing with the application target framework when building, etc.. im stumped. has anyone come across something like this?
|
|
|
|
|
The only time I've seen this happen is when the developer only tests on his/her machine.
Did you do deployment testing on a clean machine without your development environment in place? Usually you have not included a key DLL or library when you built your setup code.
Setup everything on a test machine with Visual Studio debugger running. See if you can find out from a clean machine what is happening.
Just because it works on your machine does not mean you have not screwed the pooch.
|
|
|
|
|
I want to do the following when I click on the panel.
1. I want to add a picturebox only if i click anywhere on the panel.
2. If I click again on an exisiting picturebox which is currently
being display on the panel add another picturebox on the top.
Based on the mouseclick location.
I have done the 1st step on panelClick event but not sure how to do the 2nd step.
Thanks
modified on Monday, March 10, 2008 1:51 PM
|
|
|
|
|
Adding another picture box on the top should be as simple as panel.Controls.Add(anotherPictureBox) and then anotherPictureBox.BringToFront()
|
|
|
|
|
Thanks for answering. I know how to add a control to the panel but my problem is that how can i findout either i click on the panel itself or on the control which resides on the panel.
|
|
|
|
|
Just use the Click event of the picturebox
anotherPictureBox.Click += new EventHandler(ProcessClick);
You can use the sender parameter in the event handler to know what object has been clicked.
Eslam Afifi
|
|
|
|
|
Hi, I new to C# so I have one question. On my dialog form I placed DataGridView and resize it on whole form. I populate grid with query which returns four rows total. My grid is larger and remaining space is grayed, how to force datagridview to draw empty row's to populate rest of the control?
Also, how to hide first column, the one in which moderators signs is shown (the star, right arrow...) because I'm using datagridview as read only and do not allow any modification upon control?
Big thanks!
|
|
|
|
|
I don't know if the DataGridView supports populating empty rows. If you don't like the grayed space use the BackgroundColor property.
To remove the RowHeaders set the RowHeadersVisible to false .
Eslam Afifi
|
|
|
|