|
See this:
http://www.codeproject.com/vb/net/ImagesComboBox.asp
Compile it to DLL and use it from your application in .NET
|
|
|
|
|
example:
Assume that i have Form1 and From2.Form1 is the main program and Form2 is a sub page of the program.When i press "Properties Button" in Form1,Form2 will show above Form1.So in this case we can't interact with Form1 until we have already done something in Form2 then click 'OK'.Now Form2 is now closed and we back to the main program(Form1).
something like this....How to do this in VC#.net2005
thank
Aonz
PS. Sorry with my English skill
|
|
|
|
|
Form2 needs to be treated as a dialog. To do this (from Form1):
Form2 dlg = new Form2();
if (dlg.ShowDialog() == DialogResult.OK)
{
.. Do something here.
}
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
bug_aonz wrote: So in this case we can't interact with Form1 until we have already done something in Form2 then click 'OK'
You're talking about a modal form. Calling ShowDialog will do this.
Overall, I recommend buying a book on Winforms and C# and working through it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i have a disconected imviroment database application, and normaly i need some validation rules for the data-entry part. i am using the invalidate event to check if the data is in the correct format. the problem is i want to be able to close the form is the data is not in the correct format, but i am not able to because the control refuses to lose focus until the data is in the correct format.
please help
rzvme
|
|
|
|
|
Your question really answers itself.
You have made the choise that the control should not lose focus until the format is correct. Therefore you can not escape from the control until the format is correct.
The solution is of course that if you don't want the control to work that way, you change the control so that it doesn't work that way.
Implement the validation on form level instead of on field level.
---
Year happy = new Year(2007);
|
|
|
|
|
but can i at least find out if the form is trying to get the focus so it can close, or another control is trying to get the focus?
rzvme
|
|
|
|
|
Hi, Dear Respected Programmers
I need basic help about Datagrid that How may I :-
1) create new columns and rows manually
2) add value manually
3) change or edit cell value
4) remove columns
5) remove selected columns
your corporates will be highly appreciated.
Thank you in Advance
-- modified at 5:53 Friday 12th January, 2007
|
|
|
|
|
Have you seen the DataGrid(View) articles at CodeProject? Also see this[^] MSDN link.
/ravi
|
|
|
|
|
hi
in my application initially one button event occurs due to that it executes some function during that function execution if i press any character on the keyboad my keypress event should execute instead of completing the button pressed event code.
how can i do that please help
thanks in advance.
|
|
|
|
|
I guess that you have to write control inheriting from the control youre using now and override the KeyPress envent
sth like this:
protected override void OnKeyPress(....){
if(your stuff){
....
}
else
base.OnKeyPress(e);
}
life is study!!!
|
|
|
|
|
Conceptually, the Windows GUI architecture works by having a message queue containing the list of inputs a window has received and a message pump that pops items off the queue and executes their corresponding handlers one by one. In your case, the keypress event will be put in the queue and won't be processes until the button click handler completes.
To get around this, you could delegate the button click handler code to a separate thread. This way, the button click handler returns quickly and the message pump processes your keypress. Of course, you would still need to code the handler of the keypress event and abort logic of the button click handler.
|
|
|
|
|
i have a datatable with some data.i want this data to be inserted in to the data base using SQL bulk copy.But the issue is that 2 of the columns in database have datatype "datetime" and the datatype of the corresponding columns in datatable is string.so it is not allowing me to perform SQLbulkcopy.can anyone suggest a solution so that i can use SQLBulkcopy,since the amount of records in this datatable is around 7,000 to 12,000.
|
|
|
|
|
Hi all,
How do I create the descriptions that is displayed in the intellisense for my class methods. For example, I have a class with a public method LoadData(int ID) to load data from the database. So when I'm calling the method...
int _id = 2;
class.LoadData(_id
the intellisense must give me a description of what that int value must be, for ex [The id of the database value to load]
Thanks in advance
He who laughs last is a bit on the slow side
|
|
|
|
|
You must put the descriptions over the method.
Just type /// over the method.
Then fill the description.
If you compile this class in a DLL, then you
must change in Project, Properties, Output, XML Documentation file
and fill that one with XML file. Then you must copy that
XML with your DLL if you want to get the description everytime
you give that DLL to someone else.
|
|
|
|
|
Will try, thanks
He who laughs last is a bit on the slow side
|
|
|
|
|
Thanks, works 100%
He who laughs last is a bit on the slow side
|
|
|
|
|
Hi, I’m in process of creating dlls for Web User Controls in ASP.NET v 2.0. Let me explain what exactly my problem is.
UserControl.ascx.cs to be wrapped into dll:
public partial class Controls_Search : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = testMethod();
}
public string testMethod()
{
return "Yes Iam here " + Sample.testMethod1();
}
}
public class Sample
{
public static string testMethod1()
{
return "Only";
}
}
I’ve created the dll successfully with the name Search.dll. Also i referenced this dll inside my new project. Now, whenever I load this in my page, testMethod() is being called, consequently the output is "Yes Iam here Only". That’s cool. But I should be in a position to override Sample.testMethod1()Wrapped inside the dll with my project’s App_Code class say class1.cs.
This is my new class within the project in App_Code/Class1.cs.
public class Sample
{
public static string testMethod1()
{
return "Only1";
}
}
I also tried virtual & override with testMethod1() being defined as non-static member of that class. Nothing works.
My output should be: "Yes Iam here Only1"
Thanks in advance,
chandrasekar
|
|
|
|
|
You have to inherit the class to override methods in it.
---
Year happy = new Year(2007);
|
|
|
|
|
Hi All
I have a problem that datagridview must have a print option in winfroms 2005. can any body help in this regard.
thaks®ards
sekhar
Hi im vijay working in mnc in the .Net technology from 4 years .
|
|
|
|
|
hi
i want to manage device(s) (for example send/recieve date) from usb device. does anybody can help me (tutorial,article,sample or ...) ?
thanks
|
|
|
|
|
I am trying to figure out how to update an activex control on a client workstation.
The client goes to our webserver and I want to then check for the existence of our activex component "CompA" on the client system. If the component "CompA" does not exist, I want to install it. If the component "CompA" exists, I want to check the version to see if it is compatible with the current version necessary for the webserver. If it needs updating on the client, I want to install the current (latest) version from the webserver.
Somewhere in all this I would like to be able to check that the user has enough rights on the client (not Guest or Limited) to do the update.
I have been trying to figure this out for a bit, starting with javascript trying to access the installed activex and query a method that returns it's version, etc.
The client workstations will be Win2000 or XP (or possibly Vista in the future). I don't have any control over whether the client workstations will have the .Net 2.0 SDK installed.
Thanx,
G
gary holbrook
|
|
|
|
|
Hello friends, I'm Back after a long long long time.... with another problem of course.
i'm using the listView control and using its Detail property for viewing data in column view.
Now i want to access values that are displayed in the columns,at runtime, and am not able to select the cell simply by clicking on it.ow can i select a cell by clicking on it by a mouse or navigate to a cell.
kindly help me out
Regards
Saira
|
|
|
|
|
ListView is incapable of doing this even in the details mode. ListView has only one item -which is trhe first column to the left by default-. The rest in subitems which can not be accessed by user. Amuch better control that would suit your need is DataGridView. It gives you the ability to access rows/columns in a much better way. Another solution is to use one of the extended ListViews provided here in CodeProject. Just search the articles for "Extended ListView".
Regards
|
|
|
|
|
Actually you need some workaround: you can use the X,Y position where the mouse click occurred (the MouseEventArgs provides the coords) to check if the point is inside the rectangle of the item (listview has GetItemRectangle method) you're are interested in (for instance, the selected one if there is: MouseClick may occur everywhere inside the listview) using the X coord you can then pick the right column.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|