|
|
How to show information about a picture in a picture box when put mouse over?
|
|
|
|
|
Label myLabel = new Label();
myLabel.Text = "here is an interesting pic";
myPictureBox.Controls.Add(myLabel);
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
Hi
Okay, this is my first post so please bear with me..
Anyhow. I'm working on an oldish MFC application that uses dlls as 'plugins' - similar to Photoshop, Cubase etc. Now as part of my attempts to bring some of this kicking and screaming up to date, I'm trying to add another dll for use, written in C#.
I've done the 'use managed extensions' trick, and can instantiate the C# dll by adding it as a reference, and all seems to behave as expected - but I'm having some difficulty then handling the C# form's OK/Cancel. Ideally, I'd like any information or data contained within the C# form to be passed back to the MFC form - more as a verification that whatever the dll is supposed to do has been carried out successfully or not (plus as a demo of language interoperability it seems a good idea to persuade the nay-sayers).
I figure it's going to be done through interop - so pass a handle to the parent CWnd to the the C# dll, and then post a message to it once the dll 'ok' button is pressed - but where is my main starting point for going about this? Is this the best way to go about it, or is there something I've overlooked?
thanks,
benwalker
|
|
|
|
|
Do you have control over when the C# form is launched? If so, can't you just go (in Managed C++):
DialogResult result = launchedForm->ShowDialog();
if(result == System.Windows.Forms.DialogResult::OK)
{
}
Maybe I'm not understanding your problem.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
hmm. now why didn't I think of that one - well, it saves going through interop or something else. I forget the fact that managed c++ has access to the same type of messages.. anyway - that seems to work:
thanks
benw
|
|
|
|
|
Hi,
My application needs to login to a web site automatically. Is it a way to programtically fill in the username and password web fields from a .NET windows form?
Thanks.
|
|
|
|
|
Is there a program where I allow the user to pick an Image from a Windows form and allow them to make that into a desktop WallPaper.
sahoREGS
|
|
|
|
|
I'm not sure if there is something in the .NET library, but if all else fails you can use the API call SystemParametersInfo() to do it.
Matt Gerrans
|
|
|
|
|
There's a registry key for something like that:
HKEY_CURRENT_USER\Control Panel\Desktop\
There you've got some values like ConvertedWallPaper, OriginalWallpaper, Wallpaper enz.
Hope this helps!
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
hi
can anyone tell me that can we create a button array if we can then how we will display a button using that array on the form or write text on that button.
please tell me soon
|
|
|
|
|
Why do you need to create button array? I don't know what are you working on, but array of buttons can be initialized as well as any other array:
Button[,] abtn;
of if you want jagged array, use:
Button[][] abtn;
Then traverse all buttons using for cycle and set their properties:
Button btn = Button[3, 2];
btn.Size = btnSize;
btn.Parent = this;
...
|
|
|
|
|
actually i have already create an array like but it does'nt work for its properties.
ok let me explain actually i want 64 button. and i get user input not through button through textbox. input is obviously string and every input word has specific meanging like if input is C1 its means 3rd button.
initially there is some specific text on16 button from start and 16 button from the end.
if user give 3rd button for source and 7th button for destination then text displayed on the source button is replaced to des button and source button will become blank. can u tell me how i will handle it.
|
|
|
|
|
input is obviously string and every input word has specific meanging like if input is C1 its means 3rd button
Then why not use a hashtable, with string keys and button values?
using System.Collections;
...
Hashtable table = new Hashtable();
table.Add("C1", buttons[2]);
table.Add("C2", buttons[14]);
... and so on
Then when you need to access a button based off textbox input, go
string userEnteredString = "C1";
Button button = (Button) table[userEnteredString];
Is this what you're looking for?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
ok this works. but what i want it is not working for it.
please help me .
i am explaing my problem in detail. first of all i want 64 buttons (like 8 rows and 8 columns )on my from.and i have to textbox one is for source and one for destination input.user is restricted that he gave input like a1,b1,c1,d1,............a8,b8,d8.after getting source and destination input i want to set if user gave in source tetxbox c1 its means source is 2 like this for destination.and i know these are also source and destination button numbers.
then i want to pass this inputs to a function. after some validation when function returns that source and destination is valid i want to replace source button text to destination button text. and source button text become null.how i will find out that which button tag value is equal to source also for destination and then on this basis i will change it.
please tell.......soonnnnnnnnnn
|
|
|
|
|
We can definately create button array.
Button []btnArr = new Button[5];
for(int i = 0; i < 5; i++)
{
btnArr[i] = new Button();
btnArr[i].Text = "TestButton";
btnArr[i].Visible = true;
btnArr[i].Width = 50;
btnArr[i].Height = 20;
this.Controls.Add(btnArr[i]);
}
Give location also and it will work.
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
Hi,
Normally the view GUI is driven by user input event,
(i.e. when user click a button, the UI change). But
how to update the view if the model is changed(i.e. model-driven UI). What is the pattern for this kind of view update ? And for my program design, the model-driven update seems need to update the view in another thread from the user input event thread, will this make the View not stable or having conflict ?
Thanks
|
|
|
|
|
There won't be any conflict if you won't use same data in more threads without any control. I'm doing this job declaring event handler in the class (e.g. Form) which has to be updated on background. But the form checks if it is updating now and if yes, updating process begins again:
<br />
public void Update(object obj, EventArgs ea) {<br />
<br />
if (updatingThread.IsAlive)<br />
<br />
<br />
updatingThread.Start();<br />
}<br />
|
|
|
|
|
Alright,
I ask for collective advice. We have some developers at my company who enjoy embedding their unit tests within the actual class that they're testing, (so they can test private methods), while others prefer duplicate test classes outside of each individual class. I was curious as to what the forum has to say about unit test class location.
Thanks for the suggestions,
Ryan
|
|
|
|
|
The location is http://sourceforge.net.
Search for the below tools,
NUnit can be used for class library testing. For GUI testing you can use NUnitForm.
Live Life King Size
Alomgir Miah
|
|
|
|
|
For testing private methods/properties, I'd use methods internal to the class and put them in conditionally compiled blocks. I don't like the idea of duplicating all the code in other files, because then you're never really sure you're testin the real thing.
In fact, here's another trick: rather than having any test code at all in the classes under test, just add conditionally compiled public hook methods for the private methods and write all the unit test code externally (using NUnit, most likely). The unit test code can test the private methods by using the public test methods, which would just have the same signature, but include "_Test" (or something like that) in the name.
Matt Gerrans
|
|
|
|
|
Hi,
I have developed a system which copies the files from the remote servers and put it on the local server for further process on the files.
I have around lots of remote servers shared for that and having good amount of files everyday.
My system is a single thread system and goes to each server line by line, The issue is some time it gets hanged while coping the files from one of the server because of many reasons of network and does not go ahead for the other remaning server.
I am using C# and normal file.Copy method to do that.
Please tell me what is the best method of doing it and making system more better.
Thanks.
Nitin
|
|
|
|
|
How to call a stored procedure from sybase in .net(c#)?
I am using a OleDB connectionstring to connect to sybase database, but I don't know how to call a stored procedure to execute. Can anyone help, please?
|
|
|
|
|
hi,
i have some problems using the functions
LsaEnumerateLogonSessions
LsaGetLogonSessionData.
is there a simple sample for using this functions.
maybe the problem is my structure (forgive me the vb-code)?
<structlayout(layoutkind.sequential, charset:="CharSet.Auto)"> _
Private Structure SECURITY_LOGON_SESSION_DATA
Dim Size As UInt64
Dim LogonId As LUID
Dim UserName As LSA_UNICODE_STRING
Dim LogonDomain As LSA_UNICODE_STRING
Dim AuthenticationPackage As LSA_UNICODE_STRING
Dim LogonType As UInt64
Dim Session As UInt64
Dim Sid As IntPtr
Dim LogonTime As Int64
Dim LogonServer As LSA_UNICODE_STRING
Dim DnsDomainName As LSA_UNICODE_STRING
Dim Upn As LSA_UNICODE_STRING
End Structure
many thanks in advance.
regards, thilo.
|
|
|
|
|
Hello,
How can I format the decimal output to 4 decimal points only?
Thank you.
|
|
|
|