|
Have you tried using ControlPaint.DrawGrid ?
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
ah thats much better. thanks.
|
|
|
|
|
Hi,
I would like to make a custom form class in c# (think Winamp). I am not sure where to begin; how low in the class hierarchy should i inherit to override the windows container?
I haven't found any attempts at this yet, but any direction to such would also be great!
|
|
|
|
|
I think Terrarium[^] will be a good start.
Cheers,
Kannan
|
|
|
|
|
Not sure what I did but the form controls in the Toolbox have dissapeared. The only remaining control is the pointer.
I am using Visual c#.net.... 2003 edition.
Does anyone know how to correct this ???
Thanks,
Ken
|
|
|
|
|
ken-l1 wrote:
Does anyone know how to correct this ???
Make sure you have a design surface active
<a TITLE="See my user info" href=http:
|
|
|
|
|
the toolbox has several sections in it including:
Data
Dialog Editor
Components
Windows Forms
General
if you are in the General section all you will see is 'Pointer'.. also make sure you have a dialog selected to edit like another user pointed out.
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
I have a chunk of data that is pulled from a database. I want to insert a new column into the dataset, and have every cell in that new column have new values based on an existing columns values. IE:
-Price----Amt.------NewColumn
---------------------------
100 | 2 |
220 | 4 |
335 | 5 |
400 | 6 |
554 | 8 |
655 | 9 |
| | Say I want 'NewCol' to equal Price * 2.2, so the new data set would look like this:
-Price----Amt.------NewColumn
---------------------------
100 | 2 | 220
220 | 4 | 484
335 | 5 | 737
400 | 6 | 880
554 | 8 | 1218.8
655 | 9 | 1441
| |
I hope this isn't too confusing. It's really just like I would do using Excel. having a column's values based in part on another column.
How would I approach this?
Steve
McLenithan
Is Bert Evil? | Homer: "Hello, operator, gimme the number for 911!"
|
|
|
|
|
add an expression column. The way to do that is
Dataset.Tables["tablename"].Columns.Add("columnname",Type.GetType("the type like System.String"), "the expression like equal Price * 2.2")
so
Dataset.Tables["tablename"].Columns.Add("NewCol",Type.GetType("System.Double"), "equal Price * 2.2")
that's it
From Greece:
Dimitris Iliopoulos
dimilio@yahoo.com
|
|
|
|
|
Thanks for the reply. I am trying to do what you have shown but I am getting an error; Where you put System.String for the
'int' denotes a 'class' where a 'variable' was expected
I dont get that because intellisense is showing it should be something like you had shown.
Also how do I figure out the expression. Do I simply use the names of the database columns in a mathematical formula string?
Thanks for the help
Steve
McLenithan
Is Bert Evil? | Homer: "Hello, operator, gimme the number for 911!"
|
|
|
|
|
|
Completely new to C#.
can anyone give me a big picture on how Timer works in C#?
For example, what is the framework for me to do a certain job, say methodX(), every 5 seconds?
thanks in advance!
|
|
|
|
|
Timers are really simple to use in C#.
All you have to do is declare a timer:
private System.Windows.Forms.Timer timer1; or drag it onto your form.
Setup the interval and add a message handler:
this.timer1.Enabled = true;
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
private void timer1_Tick(object sender, System.EventArgs e)
{
// add your code here. right now tis fucntion will get called once every second.
}
Hope this helps.
|
|
|
|
|
Good morming gurus,
Do you know a good source on how to alternate color on every other items of list box or combo box?
Thanks so much
Khang Nguyen
|
|
|
|
|
This is what I did in a listview control. The code below changes every other row to a different back color.
private void ColorRow()
{
if( m_bListViewBackColor )
{
m_bListViewBackColor = false;
}
else
{
m_bListViewBackColor = true;
}
ListViewItem Lvi;
// Add a listitem
Lvi = m_ListView.Items.Add( 1 );
Lvi.SubItems.Add( "John" );
Lvi.SubItems.Add( "Smith" );
if( m_bListViewBackColor )
{
Lvi.BackColor = Color.Crimson;
}
else
{
m_bListViewBackColor = false;
Lvi.BackColor = Color.White;
}
}
Declare m_bListViewBackColor at the top of your app.
This isn't exactly what you're looking for, but I think it should get you headed in the right direction.
|
|
|
|
|
Thank you very much for the tip, Manster!
Khang Nguyen
|
|
|
|
|
Hi !
I'd like to implement basic image processing like gamma, brightness and contrast.
I found on codeproject an excellent article by Christian Graus on image processing with GDI+.
Problem is that method is very slow. I compare it with Microsoft Photo Editor (included with MS Word) and it's much faster.
Maybe my method isn't the best one:
On Filter Attribut Changed:
Bitmap b = m_OriginalImage.Clone();
Filters.Brightness(b, BrightnessAttribut);
Filters.Contrast(b, ContrastAttribut);
Filters.Gamma(b, GammaAttribut);
pictureBox.Image = b;
End
Help's appreciate.
Thanks
--
aer@s
|
|
|
|
|
Does anybody know how show "welcome" dialog while the the rest of the application is being loaded (C#)?
Thanks a lot,
Andrey
|
|
|
|
|
here is what im using in my apps:
AboutBox myAboutBox = new AboutBox();
myAboutBox.Show();
myAboutBox.Refresh();
Thread.Sleep(1500);
InitializeComponent();
myAboutBox.Hide();
myAboutBox.Dispose();
i find that you need to call the Refresh() before doing anything cpu intensive or it might not show cause its too busy processing other stuff..
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
If you do a Thread.Sleep the rest of the application will not be loaded. Why don't you try something like that
<br />
public class Form1 : System.Windows.Forms.Form<br />
{<br />
....<br />
Form2 frm= new Form2();<br />
public Form1()<br />
{<br />
Thread thread = new Thread(new ThreadStart(StartForm2));<br />
thread.Start();<br />
frm.Close();<br />
}<br />
<br />
private void StartForm2()<br />
{<br />
if (frm != null)<br />
frm.ShowDialog();<br />
<br />
}<br />
....<br />
}<br />
|
|
|
|
|
if you look back at my code you'll see that the Thread.Sleep(1500) is just to pause for a second.. i know nothing is going to happen during that time..
right above that is where i load all of my stuff.. i just pause so that the splash screen is showed for at least a second, it serves no other purpose and can be removed. this is all in my constructor for my main form..
what is the benefit of creating a thread just to show and close the dialog when you could just show and hide the dialog around the section of code that does your loading?
AboutBox myAboutBox = new AboutBox();
myAboutBox.Show();
myAboutBox.Refresh();
Thread.Sleep(1500);
InitializeComponent();
myAboutBox.Hide();
myAboutBox.Dispose();
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
I'm sorry if I'm offended you I didn't want to criticize your code.
What I'm saying is if that guy wants to show a form during the load of the real application, in my opinion is better to show it in a different thread because it guarantees that the form will be shown and you will not get a blank screen because the application is busy doing other things. But of course you can also use tricks like Refresh() or Application.DoEvents() doesn't matter.
|
|
|
|
|
ah.. i was wondering why i had to refresh the form to make it show.. i guess i can see how having another thread could help them both.. especially if you wanted your loading form to have some sort of animation or something.. btw, i wasnt offended, i honestly wanted to know the purpose
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Thanks guys for your replies.
Jose, when I try to close the "start" form, the main form losts focus. Any ideas how to dial with that?
------------------------
Andrey
|
|
|
|
|
my guess is that if you just called Focus() it would get focus back
Form1.Focus();
thats my guess
still a newb.. cut me some slack :P
-dz
|
|
|
|