|
Thx in advance.....
Could u pls help me how to get the active tab's url in IE7 & Mozilla Firefox by using C#.
|
|
|
|
|
Hi,
I need to add some custom tweaks to the regular windows radio button and check box. Basically, i need to tamper with the colours throughout the different events (roll over, disabled,selected...) and cater for the size of the control as well as the distance between the control and its text. I am inheriting my control from the usual System.Windows.Forms.RadioButtton/CheckBox. Can you please give me a tutorial or example that i can follow to achieve this?
Thanks beforehand.
Yours truly,
Krugger
|
|
|
|
|
You should write your own controls which inherit from the controls you mentioned and extend their functionality. Perhaps you will need to override OnPaint event
|
|
|
|
|
Yes, this is indeed what i need to do. The thing is that i am totally new to Windows controls and do not know how to work this around. Can you plz give me a tutorial or an example i can follow?
Thanks
|
|
|
|
|
|
talking abt tutorial... have a look at this.
use thi URL in MSDN
ms-help://MS.MSDNQTR.v80.en/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_mclictl/html/f88481a8-c746-4a36-9479-374ce5f2e91f.htm
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Thanks guys. I will have a look at it ASAP.
|
|
|
|
|
Hey guys (and girls :->),
My project contains a few win-forms having the FormBorder property set to None. I created a title bar using a Panel containing a few buttons and a label for the window title. When such a form is shown using the ShowDialog method, the window will obviously not blink when the user tries to click outside the dialog window, what 'normal' win-forms including a title-bar do. Now I know there's a possibility to catch such an event using Windows Messages or something anyway... I'm not familiar with Windows Messages. Anyone with usefull hints to get me started??
|
|
|
|
|
I am trying to Insert Foreach statement
OleDbadpSource.Fill(dsSource, "Contacts");
string CNN = "id";
foreach (DataRow row in dsSource.Tables["Contacts$"].Rows)
{
OleDbcmdSource.CommandText = "INSERT INTO Address";
Items.Add(row["id"]); //I get an error "No overload for method 'Add' takes '1' arguments"
}
|
|
|
|
|
It means the Add method does not contain an Add() method which allows 1 argument.
What is the type of Items, I cannot find a declaration in your code... Maybe you need to add a few arguments in order to get it working...
|
|
|
|
|
Thanks for your prompt reply. I debugged that problem. Now the code works. However, the goal to create a foreach statement was to insert data from the dataset to the table in the SQL Server. Which has not yet taken place.
If you or anybody can help me with that. It will be very much appreciated.
|
|
|
|
|
Erhm, that's quite something your asking us. There are loads of ways to insert data into a database from any application. The first huge question is your application structure. If you use a neat n-tier app, your database are coded in a seperate project. However to get you going we'll implement the quickest way to insert data in your database, but keep in mind, though the code works, it's might not be a 'best practice' way to implement the functionality.
To implement a quick way to insert data into your database, create a SQL Insert statement. Therefore you need a stringbuilder which is the quickest for string manipulation.
StringBuilder sbInsert = new StringBuilder();
sbInsert.Append("INSERT INTO ");
sbInsert.Append("DatabaseTableName (");
sbInsert.Append("field, field, field, field"); // <-- Those fields are your database table column names
sbInsert.Append(") VALUES (");
sbInsert.Append("'Value 1',"); // <-- This the value in your database for the first field
sbInsert.Append("'Value 2',"); // <-- This the value in your database for the second field
sbInsert.Append("'Value 3',"); // <-- This the value in your database for the third field
sbInsert.Append("'Value 4'"); // <-- This the value in your database for the fourth field
sbInsert.Append(")");
Now you have the SQL statement, you'll only need to execute that query in your SQL Server. Therefore you'll need a SqlCommand object and a SqlConnection object.
SqlConnection sConn = null;
SqlCommand sComm = null;
try
{
using (sConn = new SqlConnection(ConnectionString[^]))
{
sComm = new SqlCommand(sbInsert.ToString(), sConn);
sConn.Open();
sComm.ExecuteNonQuery();
sConn.Close();
}
}
Catch (Exception ex)
{
MessageBox.Show(ex);
}
|
|
|
|
|
What about the pathname for the Excel data to upload on the server? Don't we need that in your above code??
strPath = Server.MapPath();
|
|
|
|
|
T4AMD wrote: What about the pathname for the Excel data to upload on the server? Don't we need that in your above code??
Who said anything about Excel? What does excel have to do with it?
-- Always write code as if the maintenance programmer were an axe murderer who knows where you live.
Upcoming FREE developer events:
* Glasgow: Agile in the Enterprise Vs. ISVs, Mock Objects, SQL Server CLR Integration, Reporting Services, db4o ...
* Reading: SQL Bits
My website
|
|
|
|
|
i put a message about use from gdtwain.beacuse i have a error:gdtwain.twainclass.twainclass() is in accessible deu to itsprotection level but is public.however i can't use twainclass please help me.thanks
|
|
|
|
|
Dear All,
Can we filter out the input char other than hexadecimal digits (0-9,A-F) by just setting the Mask string? If it's possible, please tell me how to do it. Many thanks in advance.
Cy
|
|
|
|
|
Check out the event KeyPress on maskedtextbox and use it.
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Thanks, Rocky. With no doubt, a little programming is still needed.
|
|
|
|
|
I am trying to draw a set of lines within my application window that would show up as an overlay over the existing GUI controls (buttons with images on them)
I can draw the lines in the Form's on paint method, but the buttons are occluding them... is there a way to draw the lines after the buttons have been drawn so that the lines are not occluded?
I thought about using a transparent form that would sit on top of the other form and draw to that.. but I think that will stop me from being able to interact with the buttons..
does anyone know how to draw overlay stuff over controls?
I hope the answer is not to override the buttons on paint...as putting the code there just doesnt seem right.. the overlay is not part of the button objects..
Clear as mud, right?
James
|
|
|
|
|
Whatever else you do, if the button is invalidated, it will repaint itself. You could try using the CreateGraphics method to draw 'over' the buttons, and see if that works, but that definately gets voided when the control is invalidated, I'm just wondering if the main form gets the last say in that event cycle, so it's paint event might draw it again for you.
I'd have though you need to override the paint on the button.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I think the button has the last word there... as when I draw it in an overridden OnPaint method for the form.. the buttons occlude the lines.
I have not looked to see if the buttons are being invalidated unnecessarily. I will check that.
|
|
|
|
|
You are not the first to try this.
Have a look at Andrew Parsons story[^]
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thanks for the tip.. he seems to be having the exact problem I am..
I like the idea of drawing to a tranparent panel as an overlay.. but I haven't been able to set up a transparent panel..
anyone have tips or tricks for this?
James
|
|
|
|
|
Transparent is not transparent. Setting the BackColor to transparent only tells the control to take on the background settings of its parent container, usually the Form. So, if the form is gray, the background of the Panel will be gray. You can't actually "see through" a "transparent" panel.
|
|
|
|
|
I want to process lines of a .Doc ms-word file in c#.net,I have searched in MSDN but it didn't help.If any one give me a hint OR name of right term to search in MSDN or internet, please?
Regards
M.Neishaboori
|
|
|
|