|
i wanna drow curve in c# interface cuz i didn't know any thing about flash
|
|
|
|
|
Then search this site for examples. Several articles have been written pertaining to GDI drawing, including the drawing of curves and rounded rectangles, in C#, are found on this site.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Who is Jewish, the Trivia Game!
Judah Himango
|
|
|
|
|
You can try VG.net[^], it's soooooo cool!
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
a want a function to resume if internet connection is disconnected
can any one help me
The C Lover ..
|
|
|
|
|
http://www.pconsulting.com.au/unrealdownload/
Live Life King Size
Alomgir Miah
|
|
|
|
|
|
Hi all,
I have a custom control, derived from System.Windows.Forms.UserControl. I'm using AutoScroll in this control to provide scrolling. I've overridden OnPaint in my control to do the drawing of the control. When the user scrolls, an Invalidate() is done on the control with the area that is newly exposed so that the invalidated area is as small as possible (this is done by the framework, not by me). Now my problem is that I want to update more of the control than just the part that is scrolled into view. I see two possibilities:
- Update the whole control when the user scrolls. Unfortunately I don't see a way to tell ScrollableControl (the class that UserControl is derived from that provides scrolling capabilities) to update the whole control when scrolling; I also don't see a way to get to the scrollbars directly to connect to a Scrolled() event (as confirmed in the windows.forms Petzold).
- Change the invalidated region from within the OnPaint handler. If I could find a way to tell the control to redraw everything and not just the rectangle that was passed to Invalidate() I could do that at the top of my OnPaint() member and be done. But no matter what I try, it seems I cannot update the invalidated area without calling Invalidate(), which will also send a WM_PAINT - I don't want since I'm already in OnPaint and that will create an infinite loop! The hack I came up with is something like this:
private bool m_DoingSecondOnPaint = false;
protected override void OnPaint(PaintEventArgs pea)
{
if (!m_DoingSecondOnPaint) {
m_DoingSecondOnPaint = true;
Invalidate();
} else {
m_DoingSecondOnPaint = false;
}
... do rest of drawing here ...
}
but as you can see this means that all the drawing code is executed twice for every time I want to draw the control. Is there a better way to do this?
cheers & thanks,
roel
|
|
|
|
|
Hello,
I have:
this.styleStages.GridColumnStyles["Name"]
is there a property, that will allow me to center the Column Headers in
my datagrid? If I use Allignment property right after ["Name"], it will just center the values for the column. Any ideas?
Thank you
|
|
|
|
|
Yeah, check out the format section of the property builder in design view. You can set the alignment of the header, item and footer.
"People who never make mistakes, never do anything."
My blog
http://toddsnotsoamazinglife.blogspot.com/
|
|
|
|
|
I am doing it progmatically, so I don't even see the columns, and headers im the grid. How would you do it by coding it?
Thank you
|
|
|
|
|
Hello there
I have created an event in my userControl with the name "MyEvent"
now I have one windows form inside UserControl to display some records if they cannot be displayed on the usercontrol ( something like popup Form)
MyEvent (the created event) fires on the click of record on userControl. I want to run that event on my popup Form as well. but when I created the event in popup form it stays null so it never fires. How Can I trigger the event on the UserControl child form (popup form) to pass the values to UserControl main event "MyEvent" so that they can be further passed to sample demo application form testing this control ?
|
|
|
|
|
i wanna make some controls like textbox or buttons visible only on the event of double click on a picturebox
i wrote
if(pictureBox1.click)
{
textBox1.visible=true;
}
but it doesn't work
|
|
|
|
|
Learn about events before looking for help here . It's elementary knowledge in application programming.
Okay - you wrote this:
<br />
if (pictureBox1.Click == true)<br />
{<br />
...<br />
}<br />
This just checks if there is any event handler. You must hook-up new event handler first:
<br />
pictureBox1.DoubleClick += new EventHandler(PictureBoxOnDoubleClick);<br />
Then add this handler and add your code.
<br />
void PictureBoxOnDoubleClick(object o, EventArgs e)<br />
{<br />
textBox1.Visible = true;<br />
}<br />
If you don't know why the parameters are object and EventArgs, learn sth about delegates.
|
|
|
|
|
pls try this code , i hope it can help
1-drage a button1 on your form
2-set its visible proprty to false in thje proprties window
3-drage a picturebox1
4-double clic pic box & u,ll find
private void pictureBox1_Click(object sender, System.EventArgs e)
{
}
this is an event defination so replace "click" with "DoubleClick" like this
private void pictureBox1_DoubleClick(object sender, System.EventArgs e)
{
}
5-open the +win form generated desiner generated code
6-open the + private void intialize component
7-search for this
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
8-replace with
this.pictureBox1.DoubleClick += new System.EventHandler(this.pictureBox1_DoubleClick_1);
9-private void pictureBox1_DoubleClick_1(object sender, System.EventArgs e)
{
button1.Visible=true;
}
where button1 is the button1
feel free to e-mail me at c__lover@hotmail.com
The C Lover ..
|
|
|
|
|
I am fairly new to C# and am trying to export the text from a multi-line textbox to an external file. I am familiar with SaveFileDialog when exporting the contents of a DataGrid, but am unsure as to how I would assign the textbox data.
Here is what I would have done if I were exporting the data from a C1TrueDBGrid. I am sure that I am just missing something simple
-------------------------------------------------------
protected virtual void Export()
{
System.Windows.Forms.SaveFileDialog saveFileDialog = new SaveFileDialog() ;
saveFileDialog.Filter = "Excel |*.csv|Text|*.txt" ;
saveFileDialog.InitialDirectory = @"C:\" ;
saveFileDialog.OverwritePrompt = true ;
saveFileDialog.FileName = "dbview_" + this.tableName.Replace(" ", "");
saveFileDialog.Title = "Database View for " + this.tableName.TrimEnd() ;
saveFileDialog.ShowDialog() ;
try
{
if (System.IO.File.Exists(saveFileDialog.FileName))
{
System.IO.File.Delete(saveFileDialog.FileName) ;
}
this.c1TrueDBGrid1.ExportToDelimitedFile(saveFileDialog.FileName,
C1.Win.C1TrueDBGrid.RowSelectorEnum.AllRows, ",", "", "", true, "ASCII") ;
System.Diagnostics.Process.Start(saveFileDialog.FileName) ;
}
catch {}
}
|
|
|
|
|
Here is part of an example from MSDN that shows how to write text to a file:
StreamWriter sr = File.CreateText(FILE_NAME);<br />
sr.WriteLine ("This is my file.");<br />
sr.WriteLine ("I can write ints {0} or floats {1}, and so on.", 1, 4.2);<br />
sr.Close();
---
b { font-weight: normal; }
|
|
|
|
|
That was exactly what I needed and worked great! Thanks and have a good one!
|
|
|
|
|
I am having trouble to set my drawing shape in center. When I used translatetransform and it went perfect center. But when I used scaletransform, it went bigger and went different locations. I didnt get it at all. I tried to do different methods and I still dont get it. tell me what is going on. Thanks!!
private void Part_PreviewPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
GraphicsPath grfxPath = new GraphicsPath();
//
//added grfx by using graphicspath shape:line,arc,etc///
//
float fMidPointX = nPanelWidth/2;
float fMidPointY = nPanelHeight/2;
e.Graphics.TranslateTransform(fMidPointX,-fMidPointY);
e.Graphics.ScaleTransform(7.0f,7.0f);
e.Graphics.DrawPath(new Pen(Color.Black, .03f),grfxPath);
}
|
|
|
|
|
All transformation you do are composite of each other.
If you translate and then scale, then the translate will also be scaled.
To get your desired effect, divide you translate by your scale:
float fMidPointX = nPanelWidth/2;
float fMidPointY = nPanelHeight/2;
e.Graphics.TranslateTransform(fMidPointX/7f,-fMidPointY/7f);
e.Graphics.ScaleTransform(7.0f,7.0f);
e.Graphics.DrawPath(new Pen(Color.Black, .03f),grfxPath);
your pen will also be scaled, so instead of now being 0.03f, it will be 0.21f
|
|
|
|
|
Hi
I have a TapControl witch contains Open, Settings, Grade, Statistics and Queries taps and I arranged them in the collection property in the above arrangement. But, when I execute my program it arrage them as Open, Settings, Statistics, Queries, Grade. It was working well and I faced this problem today and tried to solve it but nothing..
please help.
|
|
|
|
|
|
I am not using stored procedures, my table looks like this:
+---------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-----+---------+----------------+
| ProviderID | int(11) | | PRI | NULL | auto_increment |
| CompanyTitle | varchar(255) | YES | | NULL | |
| CompanyEmail | varchar(50) | YES | | NULL | |
| Website | varchar(50) | YES | | NULL | |
+---------------+--------------+------+-----+---------+----------------+
The value of ProviderID is automatically generated by the database, to insert data into the table, I am using the following code:
MySqlCommand myInsertCmd = new MySqlCommand(
"INSERT INTO myTable (ComapanyTitle, CompanyEmail, Website, ContactPerson, AddressID)
VALUES(?CompanyTitle, ?CompanyEmail, ?Website, ?ContactPerson, ?AddressID)", myConnection);
myInsertCmd.Parameters.Add("?CompanyTitle", MySqlDbType.VarChar,
255, "CompanyTitle");
myInsertCmd.Parameters.Add("?CompanyEmail", MySqlDbType.VarChar, 50, "CompanyEmail);
myInsertCmd.Parameters.Add("?Website", MySqlDbType.VarChar, 50, "CompanyEmail);
myAdapter.InsertCommand = myInsertCmd;
now, whenver I get a new row, I immediately insert it into the database, like this:
myAdapter.Update(myDataTable);
Is there a way, I can get the primaryKey of the newly insert row?
Thanks...
- A programmer's national anthem; "AAAAAHHHHH!!!!"
|
|
|
|
|
|
Ok, I am lost with these UserControls and passing inforamtion between them.
I have two projects set up in my solution. The first project contains a form and refrences the other one. The other one has my UserControls and Person Class in it.
The Design is:-->
I have a form and on that form I have two of my own usercontrols.
One is a control with three text boxs on it and an add button and a cancel button. the other UserControl has just a listbox.
What I want to do is have the user fill in the text boxes with personal information (name,age)
and then hit the add button and have that displayed in the list box on the other userControl.
Where I'm having trouble is when I'm trying to access the listbox from the add button event.
Since the list box is in another usercontrol I just can't say this.listbox1.text = whatever" . Can someone help me on this?
(FOR RIGHT NOW IT COULD BE JUST A WORD, I JUST NEED TO UNDERSTAND USERCONTROL INTERACTION when placed on a form separately)
Thanks.
The greatest gig .... LIFE!
|
|
|
|
|
Why to use two UserControls? Wouldn't be two GroupBoxes better?
OK, if you have separated UserControls which share some data, put these data into higher level of hierarchy.
An other way is to make reference in one control to another one, or one's ListBox (via property).
If I would solve this problem myself, I would use some collection (like PeopleCollection). The Add button would be in second UserControl, which controls the collection and keeps one person active. First UserControl would just edit the properties of Person and contains some Apply button which changes the properties of active person (first control contains some ActivePerson property).
Hope this helps a bit.
|
|
|
|
|