|
I have a panel with tons of controls displayed vertically. ( about 3 x the length of the panel )
When I scroll to the bottom it works fine.
But, when I scroll up it resets back to the oringal position.
For instance, I scroll all the way to the bottom.
I then click in the middle of the scroll bar so it goes up a page. But it doesn't move.
But, then I notice if I click in the panel and then click on the scroll bar. It moves.
Any ideas on a work around?
-- modified at 15:35 Sunday 13th August, 2006
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
How can I add an HTML file as a resource to a binary, and how to reference it from my code?
(VS2005)
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
Tree<t> in C# || Fold With Us! || sighist
|
|
|
|
|
Add the file to your project and in the properties window change the build action to embedded resource. Use Assembly.GetManifestResourceStream to get a stream to the embedded html file.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi,
I'm getting a HD serial number from the WMI and saving it to a var:
SerialNo = wmi_HD["SerialNumber"].ToString();
which works fine. And on my system, I can do this:
MessageBox.Show(GaugeGlow.Program.theHD.SerialNo +
"\tCount: " + GaugeGlow.Program.theHD.SerialNo.Length);
and get the correct:
WD-WCA8E5870675 Count: 15
but on someone else's computer I get:
E17CCYE Count 20
I haven't a clue why. Anyone shed light on what I might look at?
Patrick
|
|
|
|
|
Print out the character codes for each character in the string. Perhaps it's padded with spaces or unprintable characters.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks, it turns out that it was padded with spaces, so I just added a
.Trim() and now it works fine.
Patrick
|
|
|
|
|
i need to declare public variable in c# that will available from any form in my project and keep it's value during appliction running like public varaible that we declared in module in vb
ma_refay
|
|
|
|
|
static. isn't a good design tho
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
public class MyFirstForm : Form
{
public int Foo = 5;
}
public class SomeOtherForm : Form
{
public void ChangeFirstFormValue(MyFirstForm instance)
{
instance.Foo = 10;
}
}
|
|
|
|
|
I have a bit map created that is the size of 32x32
When I drag the object I am redrawing it in every paint event. But it is much larger. Appears to be about 48x48.
When I check the hight and width it says 32.
Although the vertical and horizontal resultion is 71.3.
Can anyone tell me how to appear in exact pixels of 32x32?
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
nevermind Grp[hics.DrawBitmap defualts to a format different than Pixel. Its works now when I specify pixel
--------------------------------------------------------
1 line of code equals many bugs. So don't write any!!
My mad coder blog
|
|
|
|
|
Hello..I'm trying to make my first console app in c#. I've just read a very good book and some articles. So, I'm sure many of my fistr questions may seem very dumb for most of you...please don't be so hard ;o)
Q: I sow that to declare a constant value, it should be declared indide a class. So...what if I want to declare a constant value with scope in my whole app?..should I declare a big class envolving all the code?. Is this a good practice valid even for console and windows apps?
Thanks
|
|
|
|
|
You could do a class like that:
public class Constants
{
static const int MIN_SOMETHING = 5;
}
You can then access them in your whole project like that:
int test = Constants.MIN_SOMETHING;
This is okay for the most important global constants/variables you might need. But don't populate a class just full of static methods to act like an old C program
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Perhaps an enum is what you're looking for?
public enum Priorities
{
High = 10,
Medium = 5,
Low = 1
}
...
int priority = (int)Priorities.High;
Typically, you don't deal with "globals" per se; everything is contained in a class. Now, if you truely do need a 1 instance class with values in those, you can look into using a static class. But there are only rare occassions for this; whenever I see lots of static classes, especially those that share state between other classes, I immediately think "bad design".
|
|
|
|
|
Oh, thanks a lot friends(both of you). I'm happy to find a place to ask my newbie's and more advenced quiestions.
You're very kind.
-- modified at 17:28 Saturday 12th August, 2006
|
|
|
|
|
Question1
i want to get datagrid cell position when somebody click the particulr cell.usig C#.
Question2
i want to enter combobox in to column in a existing datagrid.usig C#.
hasitha
|
|
|
|
|
Answer1.
add a event, datagrid_cellclick(sender, e).
then you can use e.RowIndex and e.Column ...
Answer2.
if you are using VS2005. you can use DataGridViewComboBoxColumn
(sorry, I didn't have VS2003, if you means in VS2003)
|
|
|
|
|
Could anyone help me how to pass parameter in crystal report using c#.net?
I'm new to this.I need a sample code
Thanks In Advance
REGARDS,
s_mostafa_h
|
|
|
|
|
our solution:
--
create a table in database as crystal report settings.
|
|
|
|
|
In Form1 I've a checkbox . I created a parameter in crystal report .
this is my code :
in btnReport_Click :
{
string strQuery = "SELECT Name FROM MyTable";
sqlconn.Open();
daAdapter = new SqlDataAdapter(strQuery, sqlconn);
SqlCommandBuilder scb = new SqlCommandBuilder(daAdapter);
da.Fill(DatatSet1.MyTable);
ParameterField paramfield = new ParameterField();
ParameterFields paramfields = new ParameterFields();
ParameterDiscreteValue discreteval = new ParameterDiscreteValue();
paramfield.Name = "Name";
discreteval.Value = DataSet1.MyTable.Columns[0];
paramfield.CurrentValues.Add(discreteval);
paramfields.Add(paramfield);
crystalReportViewer1.ParameterFieldInfo = paramfields;
crystalReportViewer1.ReportSource = crystalreport1;
sqlconn.Close();
}
I want to take a report from all of records' Name field of the Table When The user checked "CheckBox1" Control .
I have an Error in this part :
discreteval.Value = DataSet1.MyTable.Columns[0];
with this message :
Value does not fall within the expected range.
Please Help Me !
Regrds ,
s_mostafa_h
|
|
|
|
|
copy this, and paste in VS Help address box:
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/crystlmn/html/crtsktutorialsrdparametersdiscrete.htm
this is
Tutorial: Reading and Setting Discrete Parameters
|
|
|
|
|
it didn't help me .
in any case , when the user checked the checkbox contrlol , I want to dislpaly all of the specied field record (for e.g. "Name"), How can i do in this section :
<big>discreteval.Value =???</big>
thanks
s_mostafa_h
|
|
|
|
|
ParameterDiscreteValue.Value Property
Gets or sets the value of the parameter. This can be a string, number, currency, Boolean or date.
--
try discreteval.Value = "special_name";
|
|
|
|
|
this shows only one record of field that we specified . but I Want to show all record this field column .
my field is "Name" in the table .
regards,
s_mostafa_h
|
|
|
|
|
you can build all names in to a string, like this:
name1,name2,name3
then split it in crystal report formula editor?
I am not sure which manner you used in crystal report.
if you can't split it. I have no idea.
may be you need contact crystal report support to solve
your problem?
|
|
|
|