|
It would really help if we knew to which Control you refer. You see, there are gazillions of them in the world. Well, gazillions - (Count of Controls without scrollbars).
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
We all know gazillions minus gazillions returns NaN, so what are you saying?
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
|
|
|
|
|
I don't know which faulty IEEE number specification that you're following, but the Forty-Seventh International Congress of Standard Numerical Theory of Numbers Ending in "-illion" specifically agreed upon that subtraction of any number ending in "-illion" with any other number or sandwich should result in a tax break for corporations with bank accounts in the Cayman Islands.
I'm surprised you missed that, Luc!
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
OK, I'll have to read up on the latest IEEE publications then; let me first grab one of those Cayman sandwiches though.
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
|
|
|
|
|
Hi,
Sorry for my unclear statements. My control is a Panel. Inside the Panel, i add enough controls sothat the Scrollbar of the Panel appears.
The problem is : whenever i scroll the Scrollbar of the Panel to some position, and then i click on other Control (not the Panel, just to make the Panel loose focus), and then i click on the Panel (just to make the Panel get focus back), then the Scrollbar on the Panel automatically reset to the default position.
I have Googled and found some same questions, but none of the answers work.
|
|
|
|
|
That is an excellent reply! Thank you for your consideration.
Unfortunately, I cannot reproduce your problem. Let me tell you what I did and then you can tell me how we differ.
I created a Form. I put a Button on it and set its Dock property to DockStyle.Bottom. Then, I put a Panel on it and set its Dock property to DockStyle.Fill. I set AutoScroll to True. I added three TextBoxes, one at the top, another about two-thirds of the way down, and another beyond the clipping box causing the scrollbar to appear.
When I ran this project, I scrolled the Panel all the way to its bottom so that I could see the last added TextBox. Then, I clicked on the Button. Then, I clicked on the Panel. The Panel just sat there and mocked me. It did not, however, automatically reset to the default position.
Do you think that you could post some of your code so that we can look at it?
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi,
I did what you said and surprisingly, it did not cause the problem. Then i tried to point out what's the difference. After a while, i found out that my control which is inside the Panel, actually extends the UserControl, and that's the cause of the problem. If i change it so that it extends other Control, such as Panel, then no problem at all. I still dont know why.
In summary :
If a Panel with Scrollbar contains an UserControl, then when the Panel loose focus(user click on other Control outside the Panel) and then get back the focus(user click on the UserControl), then the Scrollbar will automatically reset to default position !
But if it's other kind of Control instead of UserControl, then everything is fine.
I'll try to find out why.
|
|
|
|
|
Great detective work! I appreciate your hard work.
I created a simple class the inherits from UserControl. I put that on the form, too. Still no scrolling.
I wonder if your custom control is the culprit.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hi Curtis Schlak,
I have tried to put a dummy UserControl into a Panel, make the Scrollbar on the Panel appear, scroll the Scrollbar to some position, then make the Panel loose focus, and then make it get back the focus by clicking on the UserControl, the Scrollbar automatically reset.
But if i replace the UserControl with a Panel, then no reset at all.
|
|
|
|
|
Could you post your dummy code? I still can't reproduce this problem.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Hello. I want to convert Tables of SQL Database to an Excel and CSV file through C#.NET Windows Application.. I tried reading few articles on internet.. and I m puzzled by seeing such codes and cant find a way to make it work..
Can anyone of you guys please help me in this.. I really need it ..
Waiting for your replies...
|
|
|
|
|
nt_virus wrote: Can anyone of you guys please help me in this
Help you with what? You didn't ask a question you just asked for help? Are you asking for someone to do the work for you? That's not really how this site works. There are some that do work that way like Rentacoder.com
|
|
|
|
|
nt_virus wrote: and I m puzzled by seeing such codes and cant find a way to make it work..
We can help if you get stuck, or provide a link to an article that sets you off in the right direction.
nt_virus wrote: I really need it ..
Within what timespan? Writing it yourself is an option, but if you don't know the language then it will take some effort and time.
Start out with writing a small prototype that reads data from a SQL Server table. Exporting the data back to Excel goes somewhat along the same route. If you get stuck with a particular piece o' code, or want explanation about something that you're puzzled about, check back here. Copy & paste the code into a new post, without the "please" and "I need it", and you'll get some helpfull answers.
Could be done in a couple o' days
I are troll
|
|
|
|
|
Hello. Thanks for the replies.
The below code works, it is made on Console Application.. but how to get the column names .. I m just getting only data..
namespace SqldataTable_to_Excel
{
class Program
{
static void Main(string[] args)
{
string path = @"C:\db.xls";
if (!File.Exists(path))
{
using (StreamWriter sw = File.CreateText(path))
{
SqlConnection cn = new SqlConnection("Data Source=NT_VIRUS;Initial Catalog=test;Integrated Security=True");
SqlCommand cmd = new SqlCommand("SELECT * FROM planets", cn);
try
{
cn.Open();
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
sw.WriteLine(dr["name"].ToString() + "\t" + dr["age"].ToString());
}
Console.WriteLine("Database has been exported.");
}
catch (Exception excpt)
{
Console.WriteLine(excpt.Message);
}
}
}
}
}
|
|
|
|
|
|
Thanks but I didn't understand .. how to apply this in my code.. could you please elaborate mate..
|
|
|
|
|
Ok, you really don't seem to know what you're doing. While CodeProject will help you when you get stuck on a problem or want advice, I don't think that anyone will hold your hand to walk you through the creation of your application. That's what books, schools, online posts (though you're confused by them), and mentors are for.
Eddy gave you SQL! If you don't know how to invoke it, then you have a lot more learning to do than I (or anyone else, I think) would want to provide to you.
First, figure out what you want to do. Then, try to learn something about it. Then, come back here and ask a better question than what distills to "Thanks for the code snippet, can you please write the rest of the code for me, too?"
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I are troll
|
|
|
|
|
i hav collection of items in combobox.when i press any key suppose to 'B' it should show all the collecton of items of B in drop list like in dropdownlist.
plz help me
|
|
|
|
|
Combobox does have an autocomplete property. Set that and autocomplete source.
Time is the best teacher; unfortunately it kills all of its students.
जय हिंद
|
|
|
|
|
Ya he is right. Set the autocomplete property and have fun . .
|
|
|
|
|
different names for the Windows Service being installed.
different configuration and data files using the same .EXE
using presentation layers.
Chandhu
|
|
|
|
|
and do you have a specific question?
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Is it a haiku?
Different questions,
Different forums,
Same answers:
I are troll
|
|
|
|
|
LOL! Funniest... post... ever!
var question = (_2b || !(_2b));
|
|
|
|