|
Hi there
Is it possible to play flash swfs in c# forms?
and also interact with them?
does anyone know how to do this?
Regards
VisionTec
|
|
|
|
|
You can use flash player control using COM Interoperability.
Just customize your toolbox and add that control to current controls from COM tab(flash player should be already installed). And for interacting with swf file you can use FSCommand . For more information refer to FSCommand documentation.
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
here is the solution:
1.right click on toolbox at general tab
2.select add new items
3.one popup window appears to add references
4.select COM tab
5.navigate to shock wave object select that
6.click on ok
7.u will see the flash object on General tab
|
|
|
|
|
Hi there
i an a newbie to c#
how can i change the date to british date format?(dd-mm-yy)
in my applications?
VisionTec
|
|
|
|
|
Here is an example:
MessageBox.Show(DateTime.Now.ToString("dd-MM-yy"));
|
|
|
|
|
A better way is to use an IFormatProvider for the British CultureInfo . For example, String.Format can take an IFormatProvider as the first parameter. This could be the CultureInfo.NumberFormat for the CultureInfo for the English (Britain) culture. By default, such methods uses the Thread.CurrentCulture but as I've mentioned you can override this behavior by passing an IFormatProvider . This is the correct way, instead of assuming and managing custom format specifiers like the previous post mentioned.
For more information about localization and culture-specific formatting, see Developing World-Read Applications[^] in the .NET Framework SDK. With regard to your question, see Formatting Date and Time for a Specific Culture[^] under the previous topic.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Everyone,
I have been looking around the web for info on how to hide/disable the 'Start Button' in WinXP using C#. Have found a few references to doing it using other languages but nothing with C#. A lot of them seem to reference 'Shell_TrayWnd'. Is this possible in C#. Need it to lockdown pc. Have disabled a lot of the functionality I need by editing the System Registry using C# and this would be the final piece of the jigsaw. If there is anyone who knows how to do it in C# or any other way, say through the Registry, I would really appreciate your suggestions,
Regards,
John
|
|
|
|
|
This is not really a programming question if all you want to do is "lock-down" the OS (which, BTW, there is no documented registry hack for disabling the Start menu - it's pretty much required). If you want your program to work as a kiosk, you can implement a full-screen application (search the previous comments since this has been covered more times than necessary) and use system hooks to disable certain key combinations that allow users to bypass your application's handlers.
There are several articles here on CodeProject that deal with hooks and you can find more information about them in the Platform SDK. For one decent article, see Using Hooks from C#[^] or search CodeProject for additional articles.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
thanks for the reply. But I have found the following VB code to do the job. It just hides the Start Button (true/false values passed). It doesnt disable it as you can still press the windows button on the keyboard, but thats not a problem. Is there anyone who knows how to implement this code is C#, or can I place it in the C# project as is an call it someway??
#####################################
'
' Paste this into a Code Mode (BAS)
'
option Explicit
'
private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (byval hWnd1 as Long, byval hWnd2 as Long, byval lpsz1 as string, byval lpsz2 as string) as Long
'
private Declare Function EnableWindow Lib "user32" (byval hwnd as Long, byval fEnable as Long) as Long
public Sub EnableStartMenuButton(byval bEnable as Boolean)
'
' Don't forget to re-enable it !
'
Dim lHwnd as Long
'
lHwnd = FindWindowEx(0&, 0&, "Shell_TrayWnd", vbNullString)
lHwnd = FindWindowEx(lHwnd, 0&, "Button", vbNullString)
Call EnableWindow(lHwnd, bEnable)
'
End Sub
'
#####################################
Thanks Again,
John
|
|
|
|
|
You simply need to P/Invoke these functions, but again I warn you that this is not the correct way to make a kiosk application. If this is your goal, you should check out the Platform SDK in the MSDN Library at http://msdn.microsoft.com/library[^].
[DllImport("user32.dll", CharSet=CharSet.Auto)]
private static extern IntPtr FindWindowEx(IntPtr hWnd1, IntPtr hWnd2, string class1, string class2);
[DllImport("user32.dll")]
private static extern void EnableWindow(IntPtr hWnd, bool enable);
public static void EnableStartButton(bool enable)
{
IntPtr hWnd = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Shell_TrayWnd", null);
hWnd = FindWindowEx(hWnd, IntPtr.Zero, "Button", null);
EnableWindow(hWnd, enable);
}
}
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hi there
i have an mdi form which has a few child forms
in the mdi form i have a status bar
how can i add text to the status bar from the child forms?
VisionTec
|
|
|
|
|
You simply need to expose the StatusBar (or better yet, the StatusBar.Text property for a better OO design in reference to encapsulation and protection) on the main form. Your child forms could so something like this, assuming that your main form (ex, MainForm ) had a String property called StatusText :
MainForm form = (MainForm)this.MdiParent;
form.StatusText = "Hello, world!" Honestly, how you provide access to status bar is completely up to your implementation. This is simply a matter of creating a good object-oriented design.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am trying to convert an old MFC GUI which fires off a continuously running C++ program into a C# GUI which will fire off a continuously running C# program. The former used two pipes to pass information back and forth. I cannot seem to find the .Net compliment of pipes in any of the .NET documentation. Any help would be greatly appreciated. Thanks...
|
|
|
|
|
|
Thanks so much. I knew that it could probably be done but I would have never found it. This looks like something I can certainly use.
|
|
|
|
|
I looked at the zip file which was referenced in the previous reply. It appears that the code simply creates the pipe process in MFC/C++ code which is then put into a DLL and imported into the C# program. Athough I am sure that this works, I was really looking for the C# compliment to pipe processing. Once my C# GUI process spawns my C# process, is there any way for the two to pass information back and forth. I am not very familiar with channels, threads, etc. so I don't know whether these would be my solution. Once again, any assistance/direction is greatly appreciated.
|
|
|
|
|
Hi,
I'm trying to encrypt data in a large text control on a C# windows form. Can anyone tell me how to encrypt and decrypt the data that's in just the text control? I've seen instances on how to encrypt and decrypt files, but not strings of data. I don't need any particular algorithm, but lets just say DESCryptoServiceProvider as an example.
Thanks
|
|
|
|
|
A file is just a stream, or an array of bytes. While the examples might use a FileStream , you could use a MemoryStream or even a StringReader , all from the System.IO namespace. Instead of relying on the examples, though, make sure you read the documentation to understand what's required. After all, a string is just an array of bytes, it's only handled differently. To get a string of bytes in a particular encoding, see the documentation for System.Text.Encoding in the .NET Framework SDK as well.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi
I want to create a small simple app that will help our users with there day to day jobs. In delphi this exe app would be around say 200k to download and install. Now if I create this in C# does anyone know how large this app could be. I've heard that you need to install the .NET framwork to run these apps and this is 20MB!! Is this correct or do you just need a cut down version? Or does XP / 2000 SPx include this framework?
Any info would be helpful - thanks
|
|
|
|
|
Man, how many times does this need to be addressed?!
Any language that targets the Common Language Runtime requires the .NET Framework to be installed, yes. Java requires a JRE, VB requires a VB virtual machine, and event C/C++ requires a runtime.
This was just asked and answer earlier today and I suggest you read the comments there. One person posted a link to a site that has a pre-linker but to use this is extremely BAD! See my comments below that.
In the future, please also click "Search Comments" above because chances are that someone's asked something already.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
The executable size will be about the same. Yes, end users need the .NET framework redistributable, 21MB. Many people running XP will already have it as it's included in Windows Update, and Microsoft will be including it in most of their future operating systems, including Longhorn.
The graveyards are filled with indispensible men.
|
|
|
|
|
Thanks Judah for that, do you know if Win 2003 server includes this framework and is installed by default?
Would I be correct in saying that if you get a web browser application with all the code held on the server then you only need the framework install on the server or would your clients also need this?
|
|
|
|
|
Windows Server 2003 comes with .NET 1.1 installed. For most smaller applications, the Framework is forward compatible (larger applications have a higher chance of using obsolete functionality). So, if you built an application for .NET 1.0, there's a chance that it'll run on .NET 1.1.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I want to draw a X axis,the X and Y data are such as following:
20000101,5.9
20000102,7.5
...........
...........
...........
20031201,5.8
The first row is year-month-day format,the second is the Y data.
Now my problem is how to draw the X axis using the first row.
it will be nice to you to give me a answer,or to give me a smilar sample.
Thanks!
|
|
|
|
|
There's plenty of examples of how to do this on CodeProject; you need only search[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|