|
We won't do your homework for you - try yourself, and ask a specific question when you get stuck
|
|
|
|
|
I have created a datagrid in C# Windows Application and i want to place a checkbox in it.I have tried this link
http://www.windowsforms.net/FAQs/default.aspx?PageID=2&ItemID=537&CategoryID=3&tabindex=3
I am able to place the checkboxes but can't make tht checkboxes working i.e.can't able to select and deselect the checkbox items.
i.e. the checkbox functionality is not enabled.
I know this in Web Application but i m here using WINDOWS APPLICATION.
How can i do this?
|
|
|
|
|
I wanna assign a textbox object to another text box object, so that to accomplish, all the properties and values present or assigned to that textbox object will be copied to this textbox object. For example, I have a textbox with it's location as (x=10,y=10) and name be "First" then another's as (x=100,y=100) and "Second". Now if i assign the first object to second object... what will happen is, it will just make a reference to the previous one. When printing.. both will point to first object only. What i want is all the properties of first object should be copied to second object and if i change some values of the second object.. it should accept those values. [I wanna have both the textbox printed in the mentioned locations]. How can this be achieved?
|
|
|
|
|
You can try cloning the object, if it implements the ICloneable interface. Otherwise, I don't see any other way than copying the properties yourself, either in code or via reflection.
|
|
|
|
|
Hi i tried my level best to achieve the task with the help you provided. But couldn't get the desired. Here is the snippet of code that i use. Can u please use this code to achieve the task with the help you provided [Icloneable interface or reflection or copying properties through code]?
TextBox tbxFirst = new TextBox();
TextBox tbxSecond = new TextBox();
tbxFirst.Location=new Point(100,100);
tbxFirst.Text = "First";
tbxSecond.Location=new Point(10,10);
tbxSecond.Text="Second";
tbxSecond = tbxFirst;
this.Controls.Add(tbxSecond);
this.Controls.Add(tbxFirst);
What i want is to have both the textboxes at the specified location with its text.
|
|
|
|
|
dear fellows i hope u will all be fine
it is my first question on any forum. so i do not know how to put a question and how to get an answer.although i have read the instructions of how to get the answer yet i m not sure.. so at least one person answer my question.
i want to add a menu item which should display in the menu when user right click on a file and some when user will point to this menu item. some other options to be shown. how to do this.pl help me (by sending code) or some reference material or help topic.
waiting for your kind response
A.Nadeem
|
|
|
|
|
Hi,
I'm not sure what your question is.
If you are creating a program (in C# as implied by this forum) then you
want to use the ContextMenu.Popup event to clear, then populate your
context menu with items that depend on the item for which context is requested.
Code would include things such as:
contextMenu.Popup+=new System.EventHandler(myPopup);
private void myPopup(object sender, EventArgs e) {
Menu menu=sender as Menu;
menu.MenuItems.Clear();
mi=addMenuItem(menu, "Copy File", new EventHandler(CopyFileHandler));
mi.Enabled=LongNameIsFileSpec;
mi=addMenuItem(menu, "Explore", new EventHandler(ExploreHandler));
mi.Enabled=LongNameIsFileSpec;
...
}
protected MenuItem addMenuItem(Menu menu, string text, EventHandler handler) {
return addMenuItem(menu, text, Shortcut.None, handler);
}
protected MenuItem addMenuItem(Menu menu, string text, Shortcut sc,
EventHandler handler) {
MenuItem menuItem=new MenuItem(text);
menuItem.Click+=handler;
menuItem.Shortcut=sc;
menu.MenuItems.Add(menuItem);
menuItem.Enabled=handler!=null;
return menuItem;
}
If you are referring to the context menu presented by Windows Explorer,
there are basically two ways to add user defined menu items:
- you can add an item for all files, all folders, or all files+folders by
creating the right entries in the System's Registry
- you can have Explorer start a small user-provided program to dynamically
add one or more context menu items very time something gets right clicked.
Hope this helps.
|
|
|
|
|
Hi
i was referring to context menu presented by windows explorer and i want to show it against all files and folders. so how to write enteries to registery... what enteries and where(in the registery)...
waiting for your reply.
thanks in advance
|
|
|
|
|
You need to use Shell-extensions for that. Try a search on the interfaces IContextMenu, IContextMenu2 and IContextMenu3.
|
|
|
|
|
Hi,
this is how I do it:
- I have my program contain a menu item to install itself as a possible
tool to open all files and folders
- when that menu item is clicked, it creates two registry entries:
HKEY_CLASSES_ROOT\AllFilesystemObjects\Shell\myProgName.ContextMenu
(Default)=text to show in context menu
HKEY_CLASSES_ROOT\AllFilesystemObjects\Shell\myProgName.ContextMenu\Command
(Default)=myProgPath %1
myProgPath can be obtained as Environment.GetCommandLineArgs()[0]
%1 means append the file/folder selected, and will result in a command line arg
For manipulating the registry, I use P/Invoke to OpenKey, CloseKey, and
RegSetValueEx since I want my code to also work under .NET 1.x;
but starting with 2.0 there are easier ways to do it.
BTW the (Default) key is accessed with name=null.
|
|
|
|
|
Hey all
Im trying to test for every possibility of a string for a user defined length
right now i have an string array with a-z0-9
and i iterate through it with an for loop
my problem is how to get it to roll over with out just making it a series of nested for loops so the user can define the length and say output me every possibility for 8-10 or 1-9
I know it would be rather large output files but thats not really a big concirne at the moment
Thanks
-- modified at 3:55 Monday 5th March, 2007
|
|
|
|
|
What is "every possibility"? Do you mean permutation[^]?
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
I'm not sure becuase all the permutations of ABC
Would be
abc
acb
bac
bca
cab
cba
but it wouldnt include
aaa
or
ccb
or just a with no other Chars
Is permutation still what im looking for?
|
|
|
|
|
I have a custom control that is just a ImageButton. How do I make a property that I can pass an event to it. Just like I can do with a normal ASP Button, OnClick="MethodToCall".
Thanks for all the help, or leads in a direction!
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
Have a look at how to construct and use delegates and events.
Phil
|
|
|
|
|
1:892
2:951
3:363
4:418
5:301
6:208
7:400
8:522
9:321
10:293
11:212
12:712
13:195
14:570
15:485
16:409
17:414
18:928
19:024
20:665
21:?
================================================================
here are 20 groups of data ,and they are selected at random from 000 to 999
based on these numbers ,can you figure out the inner relationship among these datas,and try to predict the 21th group of data?
|
|
|
|
|
I tried. But its difficult to predict. Do you know how to predict?
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
I try to predict the 21th group of data is 410
|
|
|
|
|
What do you want to achieve? Is this homework? I guess it is not very difficult to find out if you know what random means.
|
|
|
|
|
I'm trying to get server's responce (status) code and use this code:
int statusCode;
try
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Method = WebRequestMethods.Http.Head;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
statusCode = (int)response.StatusCode;
response.Close();
}
catch (WebException ex)
{
if (ex.Response == null)
throw;
statusCode = (int)((HttpWebResponse)ex.Response).StatusCode;
}
But when I use this code, the time of getting the result is from 300 ms to 5 s. I think this time can be cutted. Help me, please.
|
|
|
|
|
Hi!
I'm new in this forum, and I know about C# language but don't know about architecture.
I've been coding monolitic (1 tier) applications, but I'd like to learn to code (C#) applications with some tiers.
I was reading about tiers and levels but I don't know how I should to code each tier. Is each tier a class library or simply a class in a project?
Can sombody tell me where I should to read in order to learn about architecture coded with C#?
Thank you in advance.
--
Adrián Córdoba
|
|
|
|
|
aecordoba wrote: Is each tier a class library or simply a class in a project?
In hardcore tiered app each tier is on its own server Ideally each tier should know only necessary minimum (e.g UI tier shouldnt know about data storage), so divide them as much as possible - I vote for different class libraries.
FYI, there is Design and Architecture[^] forum...
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
|
Thanks, dnh! I'll check the links.
--
Adrián Córdoba
|
|
|
|
|
I made a custom control, I have a property called Text. When I try to use the control on a page the Text property is set AFTER the control has finished doing the code that needs to use the Text property.
How do I get the Text property to set the instance field prior to running most of the code? Is it an event?
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|