|
You have to create a custom control. Derive your conrol from the standard System.Windows.Forms.Textbox and Override the methods you want.
To start with
try gooling "windows custom controls textbox"
syncfusion
|
|
|
|
|
Well, thank you! I know that already. What I don't really have any idea about is if font drawing, text handling etc. is difficult and if writting such a control will consume huge amount of time.
I want to have an idea approximately how much time such a project would need: a week, a month, an year?
-- modified at 7:13 Tuesday 16th May, 2006
|
|
|
|
|
Cristoff wrote: I want to have an idea approximately how much time such a project would need: a week, a month, an year?
This is like asking "How long is a piece of string?". Basically its going to depend on so many factors such as how proficient you are with coding. How well you know the control classes, and derived controls. How many extra features do you want.
As a hint, it will take even an experienced programmer upward of a day to develop a reasonably complex control. 5 developers could work for a few months on a really really complex control.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Yeah, I know my question is stupid but probably someone has done something similar and knows how much time he has needed to accomplish it.
|
|
|
|
|
No, no. Your question is not stupid at all! However, asking how much time it will take depends entirely on you.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
I have migrated a project from VS.NET 2003 to CS.NET 2005 that uses a lot of UI and I use a main form that updates and changes after a selection is made in the main menu.
The problem is that only on one of the screens I use the menu reverts to the left side of the screen even though it is defined as RightToLeft = RightToLeft.Yes .
I have tried to put that defenition everywhere I can and nothing worked.
The only way I was able to move the menu back to the right side of the screen was by adding another empty and disabled menu item:
MenuItem m = new MenuItem();
m.Enable = false;
this.MainMenu.MenuItems.Add(m);
The problem is that it deals with the symptom and not the problem.
Does anyone knows why it happens?
Thanks,
|
|
|
|
|
hello all.
pls help as i am getting error when i try to run a web application the studio through error "can not start debugging on web server,the underlying connection was broken"..why the error pls help.I am running the application on IIS 5.0
|
|
|
|
|
open ur iis manager and check ur system name is there or not if not reinstall iis and then open visual studio command prompt
on that run aspnet_regiis -i
VMSSanthosh
|
|
|
|
|
I've got a Singleton instance of my class(A) that contains the functions for filling (passed on)datasets using 1 of 2 resident data adapters: the default adapater(A1) (for executing queries that will not be updated back to the database), and one for specially created and monitored for the query(A2) (that can be used to update data back to database). This all operates using delegates and call backs to the calling class'(B-Z) method. The database is hosted on the internet so, i need the delegation so the ui threads are not waiting for the data to return from the server.
What i'm not sure about is how the lock() will affect my program flow and what will happen when i lock the singleton instance A. At this stage i'm only locking the A1 adapter instance. I want to lock the whole instance of A so that other data requests don't interfere with the current data request.
Will it lock(A) the lock the instance in use by other classes in other threads or should i rather use a single line queue for data filling/updateing?
I would appreciate if some can enlighen me.
|
|
|
|
|
If you use lock(A), the A object will only be accessible for the thread that locked it. Any other thread that wants to access the object will wait until it gets unlocked.
There are different cursor types that decides what happens to a database result when data in tables changes. If you use a static cursor (adOpenStatic), the result is a static copy from the table, and won't be affected by changes in the table. If you can make the adapter use a static cursor, you don't have to use locking to protect the data in the result.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: make the adapter use a static cursor, you don't have to use locking to protect the data in the result.
the reason is not for data protection - its to minimize adapter creation and optimize adapter use during runtime.
Guffa wrote: Any other thread that wants to access the object will wait until it gets unlocked.
does this happen 'automaticlly' or should it controlled by the .NET Monitor class?
|
|
|
|
|
A correction to my previous statement:
The lock statement doesn't lock the object per se, it only prevents the code in the lock statement (or any other lock statement using the same object) to be entered by another thread.
The object is only used as an identifier, so it doesn't matter what object you use if you only have one lock statement.
The lock statement calls System.Threading.Enter, which uses the Monitor class. A lock statement is the convenient form of:
try {
System.Threading.Ender(theObject);
... lotsa code
} finally {
System.Threading.Exit(theObject);
}
---
b { font-weight: normal; }
|
|
|
|
|
|
What is your question?
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
Yes
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Hi all
I am in urgent need of help from you people.
In my web page the user has to insert date several times.so i thought of creating user control.I did that and it worked nicely. but the problem in that is the calendar is opening in the page.So i want to create a window for displaying the calendar and returning the date in the textbox with only c# code i.e. No javascript.
Kindly send the solution as early as possible. I want to repeat once more that i don't want javascript code to create the window only C# code is needed.
Thanks in advance
nauty
|
|
|
|
|
I think you can use the query string instead. just create a new web form and keep the calendar control on it. then when user want to select a date open that new web form. Here the user will select the date and click ok button the calendar control web form.
In the code behind for the ok button redirect the page to its origin with the selected date as query string. This link would be built when the web form is loaded from the source page, again through query string.
For this solution you will have to modify the code for the source page to accept date as a query string to the page. When you get a date through query string you can easily set it to a text box control.
there is some extra coding in this way but it is a simple solution for your problem. Reply me if you have some confusion.
Anant Y. Kulkarni
|
|
|
|
|
Good approach
|
|
|
|
|
Hi Anant
The approach is really cool.but i don't kno how new window is being made in c#(without javascript) and how to close it after redirecting it back to the parent page.
could you send me some sample code.
If you've the code for the same using javascript please send me.
Thanks for the help.
my id is ashishnautiyal@hotmail.com
nauty
|
|
|
|
|
Hi,
First of all you create a new web form for your calendar control. That means this new web form will contain only the calendar control and the ok button. Now you modify the source web form to accept a query string named, for example date like this --
private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
try<br />
{<br />
string dt = Request.QueryString[0].ToString();<br />
txrDate.Text = dt;<br />
}<br />
catch<br />
{<br />
}<br />
}<br />
You can check for post backs according to your program logic.
The code for button which will display the calendar web form will go like this --
private void cmdDate_Click(object sender, System.EventArgs e)<br />
{<br />
Response.Redirect("calendar.aspx?url=webform1.aspx");<br />
}
i have assumed that the calendar control is placed on calendar.aspx and the source web form is webform1.aspx
now its turn of the calendar.aspx web form
write following code in page load event
private void Page_Load(object sender, System.EventArgs e)<br />
{<br />
try<br />
{<br />
url = Request.QueryString[0];<br />
}<br />
catch<br />
{<br />
}<br />
}
here i have used a string variable named url to store the source url which will be sent to calendar.aspx through query string.
now for the ok button on calendar.aspx write this code --
private void cmdOk_Click(object sender, System.EventArgs e)<br />
{<br />
if(url != "") <br />
{<br />
Response.Redirect(url + "?date=" + Calendar1.SelectedDate.ToShortDateString());<br />
this.Visible=false;<br />
}<br />
<br />
}<br />
here my calendar control name is calendar1
this.visible=false will hide the calendar.aspx page. similarly if you want you can hide and show the source page. But be sure to check the visible property where it is to be set to true where to false.
hope you have understood the code. Its just simple.
Anant Y. Kulkarni
|
|
|
|
|
What you are describing is not possible without Javascript.
|
|
|
|
|
why not javascript???Ok use cookies or cross-page posting
|
|
|
|
|
hello..
i'm thinking of learning to use c++..i just know a little about developing codes..
right now i'm doing something about string..
i'd like to know a way to break a string input to char..i'm quite new to the programming vocabulary so i hope u all know what i mean..
plss help me..
fe8her
|
|
|
|
|
This is quite simple in c#.
just instantiate a new string variable and call the ToCharArray() method on it. This method returns a char[] which you can use for your purpose. I will show you an example-
string temp = "sample string";
char[] temp_array = temp.ToCharArray();
now using various loop statements you can do some processing on the temp_array.
Anant Y. Kulkarni
|
|
|
|
|
You can access characters in a string as if the string was an array of char:
string s = "Orange";<br />
char c = s[2];
You can't modify characters in a string, though, as strings are immutable. For that you would have to create an array using ToCharArray.
---
b { font-weight: normal; }
|
|
|
|