|
Hi,
now you mention textboxes. They are known to be slow, loading them is a quadratic job. How much data should they hold?
Reading 10MB of text files in 10 seconds is rather slow assuming a modern PC. What is the data, how difficult is the parsing, show a couple of lines.
And show some code!
CodingLover wrote: data adding start on a button click
What button? Or do you mean the tab of a tab page?
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:09 AM
|
|
|
|
|
Hi,
forgot to mention: if you need to add lots of items to a listing Control such as a ListView, don't
forget to call SuspendLayout beforehand, and ResumeLayout when you are done adding. Otherwise the
Control will re-evaluate its looks after every single addition, making it extremely slow.
BTW: this should not matter if you were to use data binding.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:09 AM
|
|
|
|
|
I have a scenario where I have an application that allows a user to open mulitple documents on different tabs within the application.
If the application is already running and the user opens a file associated with my application from Windows Explorer, how can I get the document to open in the instance of my application that is already executing as opposed to opening a new instance of the application?
I have seen posts that check whether or not a process / application is already running. In the examples I have seen, if the application is already running a messagebox is just displayed indicating as such. However, in my case, I need to assign the document to the executing instance of the application.
Any help would be appreciated?
|
|
|
|
|
Hi,
you need two things:
1.
the logic to detect more than one instance got launched; so the extra instances can eventually exit again.
2.
a way to pass the command line of a second instance to the first instance. That is interprocess communication, there are many ways to do it. The way I typically do this consists of:
- a named pipe, that gets created using the Win32 function CreateFile (yes that takes P/Invoke) and a fixed name;
- WriteFile to send the command line of a second instance
- a thread on the first instance, performing a ReadFile on the same pipe, and acting on anything that
comes in.
WARNING: there is a security hole: any program could now send a string to your first instance (however
any program could launch your app with some command line too).
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:10 AM
|
|
|
|
|
Hello,
I have a string of the form 12.4454554, when I want to convert to float, one exception: the format of the input string is incorrect,
I use this :
float.Parse(my string);
how to convert my string to Float (two numbers after the comma)? thank you very much.
|
|
|
|
|
Here is only the quick'n'dirty version:
string tmp = "12.4454554";
tmp= tmp.Replace('.', ',');
double rounded= Math.Round(System.Convert.ToDouble(tmp), 2);
for a clean solution have a look on IFormatProvider.
[edit]
string tmp = "12.4454554";
double rounded= Math.Round(System.Convert.ToDouble(tmp,System.Globalization.CultureInfo.CreateSpecificCulture("en-us")), 2);
works too..
modified on Sunday, February 15, 2009 7:04 PM
|
|
|
|
|
Hi
i want to create a user control and add some other controls to it.
for example add a button to my userControl and let user to interact with this button at runTime (for example, allow user to click on it) and customzie it at designTime (for example, create event handler for click event), but when i drag userControl to my form, child controls did not have any interactivity behavior.
how to do that ?
thanks
modified on Sunday, February 15, 2009 5:55 PM
|
|
|
|
|
I tried the following, an it worked:
made a winform and placed a panel on it.
Than added a Button with somethink like this:
private void button1_Click(object sender, EventArgs e)
{
Button btn = new Button();
btn.Click += new EventHandler(btn_Click);
panel1.Controls.Add(btn);
}
void btn_Click(object sender, EventArgs e)
{
MessageBox.Show("Hello World");
}
Or did you mean someting different?
|
|
|
|
|
Hi Nico
i tried it also and my problem has been solved.
thanks
|
|
|
|
|
If you want to, for example, handle the click event of a button on a usercontrol, you should be handling it in the usercontrol code - nit in the form on which ou put the user control.
Similarly,if you want to design the button, you deign it in your user control.
If you want to be able to reuse your user control with, say, a different font on the button, then you need to add a property to your user control (lets call it ButtonFont) and write the Setter and Getter to access the Button's Font property.
If you REALLY want to access the button itself outside of the user control, at runtime e.g. you want code that says
MyUserControl1.OKButton.Text = "Hello";
then you need to set the Button's 'Modifiers' property in the user control to Public - so you can access it. This is not good practice, though, better to hide the button itself, and allow access only to those properties you want to give access to.
Similarly if you want to handle the click event of the button on the user control from within your form, you need to add an event to your user control - raise the event when the button is clicked. Thus the form doesn't know it was necessarily a button click event, just that the user control is telling it that some event has occurred.
For example - if your UC is used to select from a list of items, you might allow the user t double click on an item, selec the itme th click OK,select the item and press enter, click on a linklabel - etc. etc.
By raising a single event from the user control, the 'user' of tat control doesn't need to worry about what caused the event to fire - it just needs to know that it needs to handle the event because it has been raised.
Sorry for the rambling - this is a big subject & it depends on your requirements as to what you need to do for the best.
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
|
I have a this case...
using System;
namespace FirstGenericClass
{
public classCounter
{
private int count;
public int Counter
{
get{ return count; }
}
public void Increament()
{
count++;
}
}
}
Here i want to write 2 classes, first one as a query class and the second one as a command class. How do I go about that
|
|
|
|
|
What do you want to query , and what do you want to command? So far all you have is an Int32 wrapper that has an increment method...
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
You write code. What was your question ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
If u nt gona answer the question, plz keep the f-up answers to yo self. A-hole
|
|
|
|
|
Member 3916856 wrote: the f-up answers to yo self. A-hole
Good way to alienate yourself. Good luck getting anyone to answer with an attitude like that.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
|
|
|
|
|
I'm dearly sorry about my reply. But at time a person is just looking for an answer. You can just say when you not understanding the question
|
|
|
|
|
Hi AnyBody help me.....
In my project need a schedule a program with in a clock, so i decided to create
a clock circle and if drag and drop the some program in clock(Circle)that is added
to the particular clock time.so need idea to GUI design , if i drag a program to clock
that program duration only have different color ,like wise all program are displayed different color. And main important is if i need to changr or remove the program means
click that the color and drag and drop to the out sideof the circle, that program will removed from the circle . how can i do this give some idea.... I more expecting from you.
ThankYou
|
|
|
|
|
How are you going to determine the program's duration? Surely with a Task Scheduler you can only determine the start time?
Also, what are your plans if two programs coincide - there's no easy way in your plan to implement that.
A traditional clock face is 12 hours, but we have a 24 hour day - so there's another issue.
Not trying to discourage you, it could be an interesting approach, but it may need a little more time thinking about the concept.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Thankyou for replay
The program duration already determined and that duration also maintain the database.
And clock issue was altered. Now we used every one an hour clock so that contain 60
minute. i will create 24 clock and that clock also assigned to the day grid.
Now what we want means The program are assigned to the clock(only for 60 minute).
For Example the programming(For Example consider song) duration is 10 minutes. and commercial break is 2 minutes. like wise fill an hour, if want to change the song means click the corresponding song then drag and drop out side of clock, the song
removed from the clock time that's only we want
Thankyou
|
|
|
|
|
i want 2 develop a client server architecture for DMS in education system in C# and database is SQL server so i want 2 provide a database on only server side n client can able 2 access dat database from client machine.....
plzzzzzzzz help meeeeeeeeee
|
|
|
|
|
Sounds good, with some effort it should work well. Don't forget to write an article to share with the community when you're done.
In the meantime, what specific part of your code is giving you trouble?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
OOh, and while I'm here...
madhuri pokharkar wrote: client server architecture for web appln in C#
That would be "application"
madhuri pokharkar wrote: i want 2
x 2: "I want to"
madhuri pokharkar wrote: dat
"that"
madhuri pokharkar wrote: plzzzzzzzz help meeeeeeeeee
"Please help me", and there's no need to say that. Everyone asking a question on these forums is wanting help, what would be the point in posting otherwise?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
OK. Permission granted. Please proceed.
Or did you have a more specific question about something your having a problem with?
|
|
|
|
|
Hi
I'm a 3rd year Software Development student, and for our 3rd year projects we need to create our own piece of software, which will be judged and marked throughout the year.
Our group decided on an interactive 3D environment. The main focus of our project is going to be furniture manufacturers. We want to allow them to use our program to model their own furniture, and customize them as well e.g. adjust the length and width of table legs, chairs, tables etc. We also want to integrate cost calculation, which must be dynamic, in other words the price must change as the user adjusts the dimensions.
I want to know, is this possible? Or should we start looking for other ideas.
Will users be able to work with pre-rendered models(created in TrueVision3D or any other 3D modeling application) and modify them to their liking?
Any help will be appreciated.
Thanks in advance
|
|
|
|
|