|
I set the point with this.Location in the first form and set the adjusted point just before frmView2.Show
thanks!!
|
|
|
|
|
you're welcome.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Greatings, How I can change the color text in datagridview cells?
The Visual Studio 6.0 FlexGrid has an property ForeColor.
Thanks
|
|
|
|
|
Are you using the Microsoft Flexgrid 6.0 control with C#?
In Visual Basic 6 you'd first have to set the row and column, and then simply change the color. Something like this;
With MSFlexGrid1
.TextMatrix(0, 0) = "black"
.TextMatrix(0, 1) = "red"
.Row = 0
.Col = 1
.CellForeColor = vbRed
End With A DataGridView would give you more options to play with, though
I are Troll
|
|
|
|
|
Sorry I tried with MSFlexGrid 6.0, it is a great control, it would must exit too in Visual Studio 2003, 2005 and 2008. But I have 2 problems.
- The scrollbars not work with scroll mouse
- I have Windows Seven Ultimate and i can't install Visual Studio 6.0 is not compatible. An Visual Studio 2003, 2005 or 2008 project developer with MSFlexGrid 6.0 can find the dll file or OCX file in System 32, because the Operative System had or have Visual Studio 6.0. But I can't set to Visual Studio 2005 the path of the MSFlexGrid dll.
I don't Know if Visual Basic 2005 has MSFlexGrid, I only works with C#, but VB 2005 has an MSFlexGrid i can use on C#.
Thanks.
|
|
|
|
|
Edison1885 wrote: - The scrollbars not work with scroll mouse
Because the FlexGrid was written before mouses came with a scrollwheel. You'd have to add that yourself[^].
Edison1885 wrote: - I have Windows Seven Ultimate and i can't install Visual Studio 6.0 is not compatible.
That's a good thing, actually. Why not download Visual Basic.NET Express?
I are Troll
|
|
|
|
|
But what is the difference with Visual Basic 2005, I have Visual Studio 2005 full version, all languajes, the controls are common. And FlexGrid is only in the version 6.0.
The most important for me is use the Flexgrid 6.0 with Visual Studio 2005 on Windows 7, but not to install Visual Studio 6.0 or Visual Basic 6.0.
Thanks for the link, I go to see about the scroll.
modified on Tuesday, November 17, 2009 5:28 PM
|
|
|
|
|
The only solution is build Visual Studio 2005 projects with the Visual Studio 6.0 components like MSFlexGrid 6.0, is on Windows XP Mode Virtual Machine of Windows 7, but the problem is this applications not run on Windows 7.
I can use Datagridview of Visual Studio 2005, but this component is very slow when load information, wich is not from a Database.
Please, have somebody a solution?
Thanks.
|
|
|
|
|
Hi
My problem is that i have a column Position in my database. when i try to update this column by assinging different values at the same time using update command only one row is updated.my front end is C# and back end is MS SQL Server 2000 personal edition. plz let me know that how we can update multiple rows of a single column at the same time by assinging different values.
Thanks
Usman Ahmad
|
|
|
|
|
yes we can.
example:
UPDATE `tableName` SET ID2=CONCAT('aha',ID) WHERE language='C#'
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Thanks for your reply
But still my problem is not solve when i use ExecuteNonnquery() method in this style
int result = sqlcommand.ExecuteNonQuery()
MessageBox.Show(result.ToString());
actually message box returns the message that all rows are updated but when i check Position column only one row of column Position is updated and other rows are show old values.
I want to update multiple rows of a single column Position with different positions of students
kindly sent immediate reply i am trying to solve this problem from last 10 days but no progress.
Thanks Usman Ahmad
|
|
|
|
|
To update multiple rows, you need to use the UPDATE command.
UPDATE [Table]
SET [Column] = [Value]
WHERE [Condition]
|
|
|
|
|
Thanks for your reply
But i am already using this syntax.Still my problem is how to update multiple rows of a single column with different values at runtime from C# using update query
Regards
Usman Ahmad
|
|
|
|
|
Dear Sirs,
What are people using now for their 3D rendering in C#? I see that the last managed DirectX is a little old now, and it looks like the managade libraries for OpenGL are a little old, too. Is there one of the above that's good and new that I've missed? I am using XNA, but it's very limited. For instance, I would like to render two panels in a form, and I don't see a way to do that...I just looked it up, and see a way to do that, so I'll rephrase: So, is everyone using XNA now? It seems very easy to use, and meets most needs. I'm creating medical imaging programs and would like to have lots of control over coordinate systems, and drawing many panels at the same time on the screen.
Let me know what you think! Thanks.
In Christ,
Aaron Laws
http://ProCure.com
|
|
|
|
|
XNA is not limited. What exactly are you trying to do?
|
|
|
|
|
Dear Mr. Aptroot,
Well, I'm just trying to poll users as to their preferences and current usages. I've really gotten my 3D rendering under control. I'm showing a structure set for radiation treatment, and showing where the beam intersects the patient given a certain radius and sample rate. I got that done, but I guess I'll be making more programs sort of like this one, and I was wondering if I should investigate other options. In my original post, which was surely pretty confusing, I admitted that it wasn't limited (after looking something up that I thought was a limitation). So, I guess you use XNA?
In Christ,
Aaron Laws
http://ProCure.com
|
|
|
|
|
Yes, but I've also used Managed DirectX (which is pretty much the same as XNA without the fancy extra's) and OpenGL and native DirectX
What do you really want to do though? (I don't know much about the medical stuff)
|
|
|
|
|
Dear Mr. Aptroot,
I must be particularly unclear today. I have the rendering under control, that is, I am done doing what I wanted to do, and now I don't have anything in particular that I want to do. What I WANTED to do was show a body on the screen and allow the user to investigate various structures in the body (the skin, internal organs, tumors, etc.), but I did it in XNA.
The reason I'm polling for other users' preferences is because I am sure I'll be doing more and I'm wondering if anything might be better. Thanks for your persistent help!
When you say Managed DirectX are you talking about that one like DirectX 9? Or are you referring to SlimDX? When you say OpenGL, are you accessing it through the .net, or native? Thanks again.
In Christ,
Aaron Laws
http://ProCure.com
|
|
|
|
|
Oh you're already done, that's nice
I meant the managed part of DirectX 9, I've used OpenGL both natively and through the Tao framework but found it easier to work with in a native environment, but that's just an opinion of course
|
|
|
|
|
Hi Dear all.
I`m not a C# programmer , but I manage to make a little email Pop3 reader searching in the internet. This program has a timer and every 5 min looks into an email account and read and download some information. Now what I need is the possibility to read mails from more than one email account at the same time. IE, if I have two Gmail account, the program should look into this two account every 5 min and download the info I need. Please, anyone that help me on this. I´m using Higuchi.net lib for connecting to email accounts, it´s a very good one, anybody can google it and download it, it is free. I have tried multithreading but with no luck. My code is the following:
public partial class Pop3 : Form
{
public Pop3()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (this.checkBox2.Checked != true && this.checkBox3.Checked != true && this.checkBox1.Checked != true)
{
MessageBox.Show("Select a Conection Option");
}
else
{
timer1.Tick += new System.EventHandler(this.OnTimerTick);
timer1.Enabled = true;
timer1.Start();
this.button1.Enabled = false;
}
}
private void OnTimerTick(object sender, EventArgs e)
{
if (this.checkBox2.Checked == true)
Gmail();
if (this.checkBox3.Checked == true)
Gmail2();
if (timer1.Interval != 360000)
timer1.Interval = 360000;
}
private void Gmail()
{
Pop3Client cl = new Pop3Client();
cl.UserName = "xxxxxxxxx@gmail.com";
cl.Password = "xxxxxxxxx";
cl.ServerName = "pop.gmail.com";
cl.Port = 995;
cl.AuthenticateMode = Pop3AuthenticateMode.Pop;
cl.Ssl = true;
cl.Authenticate();
if (cl.Available == true)
{
if (cl.ReceiveTimeout <= 10000)
{
if (cl.State == Pop3ConnectionState.Authenticated)
{
if (Convert.ToInt32(cl.GetTotalMessageCount()) >= 1)
{
try
{
int ncount = Convert.ToInt32(cl.GetTotalMessageCount());
for (int i = 1; i <= ncount; i++)
{
Pop3Message mg = cl.GetMessage(i);
string MyText1 = mg.BodyText;
Parse(MyText1);
}
for (int i = 1; i <= ncount; i++)
{
cl.DeleteEMail(i);
}
}
catch (Exception e)
{
throw new Exception(e.Message);
}
}
}
else
{
popup mypop = new popup();
mypop.Show();
mypop.Refresh();
}
}
}
cl.Close();
cl.Dispose();
}
private void Gmail2()
{
Pop3Client cl = new Pop3Client();
cl.UserName = "xxxxxxxx@gmail.com";
cl.Password = "xxxxxxxxxxxx";
cl.ServerName = "pop.gmail.com";
cl.Port = 995;
cl.AuthenticateMode = Pop3AuthenticateMode.Pop;
cl.Ssl = true;
cl.Authenticate();
if (cl.Available == true)
{
if (cl.ReceiveTimeout <= 10000)
{
if (cl.State == Pop3ConnectionState.Authenticated)
{
if (Convert.ToInt32(cl.GetTotalMessageCount()) >= 1)
{
try
{
int ncount = Convert.ToInt32(cl.GetTotalMessageCount());
for (int i = 1; i <= ncount; i++)
{
Pop3Message mg = cl.GetMessage(i);
string MyText1 = mg.BodyText;
Parse(MyText1);
}
for (int i = 1; i <= ncount; i++)
{
cl.DeleteEMail(i);
}
}
catch (Exception e)
{
throw new Exception(e.Message);
}
}
}
else
{
popup mypop = new popup();
mypop.Show();
mypop.Refresh();
}
}
}
cl.Close();
cl.Dispose();
}
private void Parse(string xtext1)
{
string[] xxValues = Regex.Split(xtext1, "\r\n");
for (int j = 0; j < xxValues.Length; j++)
{
string vf_values = xxValues[j].ToString();
if (vf_values != "")
{
string[] values = vf_values.Split(new char[] { ' ' });
string date = values[0];
string time = values[1].Remove(values[1].Length - 1);
string unit = values[2].Remove(values[2].Length - 1);
string clock = values[3];
string speed = vf_values.Substring(vf_values.Length - 11, 8);
string xSpeed;
string cSpeed = "";
for (int i = 0; i < speed.Length; i++)
{
xSpeed = speed.Substring(i, 1);
Regex re = new Regex(@"\d+");
Match m = re.Match(xSpeed);
if (m.Success)
cSpeed += xSpeed;
}
conexion con = new conexion();
con.Insert(date, time, unit, clock, cSpeed);
con.closingcon();
dataGridView1.Rows.Add(1);
dataGridView1.Rows[j-1].Cells[0].Value = date;
dataGridView1.Rows[j-1].Cells[1].Value = time;
dataGridView1.Rows[j-1].Cells[2].Value = unit;
dataGridView1.Rows[j-1].Cells[3].Value = clock;
dataGridView1.Rows[j-1].Cells[4].Value = cSpeed;
dataGridView1.FirstDisplayedScrollingRowIndex = j;
dataGridView1.Refresh();
dataGridView1.CurrentCell = dataGridView1.Rows[j-1].Cells[0];
dataGridView1.Rows[j].Selected = true;
this.textBox1.Text = j.ToString();
this.textBox1.Refresh();
}
}
dataGridView1.FirstDisplayedScrollingRowIndex = 1;
dataGridView1.Refresh();
dataGridView1.CurrentCell = dataGridView1.Rows[1].Cells[0];
dataGridView1.Rows[1].Selected = true;
}
private void Pop3_Load(object sender, EventArgs e)
{
dataGridView1.ColumnHeadersDefaultCellStyle.Font = new Font("Tahoma", 9, FontStyle.Bold, GraphicsUnit.Point);
dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = SystemColors.ControlDark;
dataGridView1.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
dataGridView1.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
dataGridView1.DefaultCellStyle.Font = new Font("Tahoma", 8, FontStyle.Regular, GraphicsUnit.Point);
dataGridView1.DefaultCellStyle.BackColor = Color.Empty;
dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = SystemColors.ControlLight;
dataGridView1.CellBorderStyle = DataGridViewCellBorderStyle.Single;
dataGridView1.GridColor = SystemColors.ControlDarkDark;
}
}
|
|
|
|
|
You don't need two methods Gmail1 and Gmail2 . Keep only one method and that method should accept the necessary details required for connection. You need to start two threads and execute the method. If you have any shared data that both threads will read/write, you need to use lock.
When accessing controls from worker threads you need to use Invoke /BeginInvoke to avoid cross-thread errors. This[^] ebook should help to get started.
Best wishes,
Navaneeth
|
|
|
|
|
|
Perhaps this would be more soapbox / lounge material, don't you think??
|
|
|
|
|
You are just not my type.
CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks
|
|
|
|
|
|