|
CandyMe wrote: How do I set the focus back to the user control
You may add a public method to this usercontrol, which sets focus to the control that was given to it by parameters.
CandyMe wrote: prevent the user from moving to the next tab page
Disable it.
"Praying." Is this only what I can do for him ?
|
|
|
|
|
I researched but says tab pages cannot be disabled. I will only have to remove it.
How come myControl.Focus() doesn't work?
Thank you
|
|
|
|
|
CandyMe wrote: How come myControl.Focus()
Its a usercontrol, so Focus method will focus the control itself not the inners controls.
"Praying." Is this only what I can do for him ?
|
|
|
|
|
|
Hello, I'm looking to write a image slideshow program in C# that would take a folder and show you all the .bmp's .jpg's etc etc in a folder. I know there's plenty of programs out there that would do this but this seems like a good way to increase my knowledge of C# and the .NET framework in general so I am giving it a go.
My question is I was wondering if anyone could point me in the best direction on how I should display the images, I would like to have them display in a window or full screen. The Picture Box works fine for this type of thing but not so great for doing a full screen mode.
So I was just looking for suggestions on areas of the framework I should look at for attacking this problem or if you have any architecture suggestions that would be great too!
Thanks!
|
|
|
|
|
If you are using .NET 2.0, its methods and classes of GDI will help you, you may use an invisible panel which shows up only when its full screen and set it Dock property to Fill , and then show the image as a background for it, and when he clicks Esc key, hide it and show the regular PictureBox
"Praying." Is this only what I can do for him ?
|
|
|
|
|
Is there a known problem with the release version of the C# .NET 2003 compiler as regards exception catching? Can someone point me to where Microsoft lists all known bugs? I have been searching and haven't turned it up. I found a page which listed bugs fixed in a particular release, but haven't found anything about this.
I am trying, at the top level of an application, to catch any errors which have bubbled up from below. I have a try/catch around the Application.Run that brings up the main form of an application. This is in one project. The form is in a different project.
If I build in debug mode and an error occurs on the form, the error is caught by my application. If I build in release mode, the error is not caught by may application - a message box comes up showing the error was caught by the system.
I created a sample solution to simplify the environment and the problem still occurs.
My concern is not with the particular error which is getting by my catch, but with the fact that any error is. Is there something inherently wrong with the way I am doing it, and it just happens to work in Debug configuration, or is there a problem with the release compiler?
Here is the code I used to demonstrate the problem:
From the project 'starter':
<code>
using System;
using System.Windows.Forms;
using FormPart;
namespace starter
{
public class starter
{
[STAThread]
static void Main()
{
try
{
Application.Run(new FormFormPart());
}
catch (Exception e)
{
MessageBox.Show("Exception Caught", "starter Message");
}
}
}
}
</code>
From the project FormPart in the namespace FormPart which has a populated DataGrid object:
<code>
private void button1_Click(object sender, System.EventArgs e)
{
dataView2.RowFilter = "Distance Like 'a'";
}
</code>
The error occurs because Distance is defined as a System.Double column. Again, I'm not concerned about fixing this particular error - just about how any error is getting by the catch at the top level.
Thanks for any thoughts ...
|
|
|
|
|
|
Hi!
Yes, this is a known (although not too well-known) behaviour. Until now I couldn't get a plausible explanation why this behaviour occurrs, but at least there's a workaround. Take a look at
this discussion[^] on the same topic.
Regards,
mav
|
|
|
|
|
The reason is quite simple: Windows.Forms has it's own error dialog that allows to choose "continue" if an error occured inside an event handler. Then the form tries to continue execution.
But if you're running with a debugger attached, Windows.Forms does not use it's error dialog to give the debugger (or another try-catch statement) a chance to handle the exception.
To catch all exceptions in all cases, you have to:
- create a global try-catch in your Main method
- handle the Application.ThreadException event (for exceptions in Windows.Forms)
- handle the AppDomain.CurrentDomain.UnhandledException event (for exceptions in other threads)
|
|
|
|
|
Thanks - working now. All 3 responses were helpful.
|
|
|
|
|
Hello Everybody!!!!
I have once problem .
I had developed server and client application.
Server is running on specific ip address which the ip address i took from my dialup connection and specific port.
I gave friends of mine my client application through the internet Letting them try to connect to my pc and i gave them my current ip address which i took from my dialup connection.
Then my friends failed to connect to my pc and throws exception for them telling them "Can't connect to non-connected sockets".
Something like that.
But my client applications seems not to recognize my machine on the internet i don't know why.
By the way my application and server runs successfully on both local machine and through Large Lan of about 30 pcs connected to each other in cyber cafe of internet and it works really very good but i don't know why it doesn't work for the internet .
By the way,
My connection to websites on port 80 is successfully done but i don't know why the client application can't connect to my pc By knowing my ip address and the port to connect to.
Please any one with networking ideas please refer to me with any solution or suggestions or even any idea.
Thanks.
Your friend,
Snouto override.
Mess With The Best And Die Like The Rest
|
|
|
|
|
Hi,
I've got a C# class library compiled with VS 2005 Express. Is this likely to be the reason why a #using statement in my Managed C++ project in VS2003 fails to compile? The error:
fatal error C1192: #using failed on 'xxx.dll' Is there any difference between library formats? Is there any solution?
Joel Holdsworth
|
|
|
|
|
VS 2005 is .NET 2.0 and VS 2003 is .NET 1.1 . I think you can't mix it. But I'm not sure
'A programmer ist just a tool which converts caffeine into code'
|
|
|
|
|
Joel Holdsworth wrote: Is there any solution?
The short uncomplicated answer is NO. Why not compile the MC++ project in VC Express?
xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!
|
|
|
|
|
leppie wrote:
Why not compile the MC++ project in VC Express?
Hmm... I did have a try at that for 10 minutes. It failed to #include <windows.h> .. so I had a look at the directory settings in the options box. For some reason the list of directories does not show up in this build. There's a panel called Directories, but only a big gaping hole where the list should be . So I assumed that VCExpress had been labotomised, and would be of no use... What do you think?
Joel Holdsworth
Wanna give me a job this summer?
Check out my online CV and project history[^] - now available in MSWord format![^]
-- modified at 18:52 Saturday 22nd October, 2005
|
|
|
|
|
This is a wild guess, but I think the latest Platform SDK contains the headers for VS 2005. I remember I read there was some issue. Give it a try.
xacc-ide 0.0.99-preview7 now with C#, C, C++, IL, XML, Nemerle, IronPython, Perl, Caml, SML, Ruby, Flex, Yacc, Java, Javascript, Lua, Prolog and Boo highlighting support!
|
|
|
|
|
There is no difference between a dll made using different languages. The code in the dll is IL code, so it's compiled to an language-independent format.
It's probably because the code is not CLR compliant, e.g. the code is using some constructions that are C# specific. Also, the code might be CLR compliant, but it's compiled without setting the CLR compliance flag in the assembly.
MSDN reference to the error messsage[^]
---
b { font-weight: normal; }
|
|
|
|
|
|
Joel Holdsworth wrote: So how would I set that flag - I can't see it anywhere
Add the folloeing attribute declaration to assemblyinfo.cs:
[assembly:CLSCompliant(true)]
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
How can apply the XP stlye to these controls. All the other controls on my forms such as radiobuttons, Command Buttons, etc. have adopted the XP style apar from these two. How can i force them to adopt it. I'm sure theres a way because i've seen quite a few applications with XP stlye NumericUpDown and CheckedListBox controls.
|
|
|
|
|
hi,
i have a slight problem with arrays. Heres what i want to accomplish.
I have an array A consisting of around 500 elements and another array B consisting of around 100 elements. Now i wish to remove all the items from array A that exist in array B. What would be the fastest way to do this?
Note: The array consists of strings.
|
|
|
|
|
The following code will do it:
using System;
using System.Collections;
namespace ConsoleApplication5
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
string[] names = new string[500];
for (int x=0; x<500; x++)
{
names[x] = "Name " + x.ToString();
}
string[] otherNames = new string[300];
for (int y=0; y<300; y++)
{
otherNames[y] = "Name " + y.ToString();
}
string[] final = RemoveIntersects(names, otherNames);
string foo = "";
}
private static string[] RemoveIntersects(string[] targetArray, string[] duplicateArray)
{
ArrayList target = new ArrayList(targetArray);
ArrayList duplicate = new ArrayList(duplicateArray);
foreach(string check in duplicate)
{
if (target.Contains(check))
target.Remove(check);
}
return (string[])target.ToArray(typeof(string));
}
}
}
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Probably the fastest way is to put them both into a Hashtable as key values, then get the Keys propery from it. However with only 500 of one and 100 of the other, performace shouldn't be a big issue. It won't preserve order, of course.
Here's how it would look for strings:
string [] MergeLists( string [] A, string [] B )
{
Hashtable table = new Hashtable();
foreach( string s in A )
table[s] = s;
foreach( string s in B )
table[s] = s;
ArrayList items = new ArrayList( table.Keys );
return (string[])items.ToArray( typeof(string) );
}
If you had really large collections to merge, this would probably pay off performance-wise. For smaller collections it won't hurt too much to search through for collisions (or even wrap them in ArrayLists and use Contains() ).
Matt Gerrans
|
|
|
|
|
By the way, if you are using VS.NET 2005, you can create a more generic solution:
public T[] MergeArrays<T>( T[] A, T [] B)
{
Dictionary<T,T> table = new Dictionary<T,T>();
foreach (T item in A)
table[item] = item;
foreach (T item in B)
table[item] = item;
List<T> items = new List<T>(table.Keys);
return items.ToArray();
}
Matt Gerrans
-- modified at 2:24 Sunday 23rd October, 2005
Generics syntax is a bit of a pain to mix with html (I didn't want to use the "Ignore HTML tags" option, because then I can't format the code)
|
|
|
|