|
Hello
i am working on a c# desktop application with mdi form.
i have added two images and a label to the mdi form.
its looks fine in the start. But when a child form is loaded the child form comes below the image and text box only
can anyone tell a solution for this
Regards
Hari
|
|
|
|
|
hi
i want to send and recive fax from my VC# 2005 app,but how to do??
thanks
|
|
|
|
|
A quick Google search for C# fax brings up some possible hits. Have you tried searching yet?
|
|
|
|
|
Hi,
I would like to get help on designing a .net 2.0 winform.
One or more Users should be able to be assigned to one Assignment. A percentage of the Assignment is allocated to the selected user(s). Each assignment can have one or more users assigned to it.
For example:
A manager opens the form. Selects an assignment (AssignmentNo 5) from a combo box. From a Listbox control he then selects one or more users (User1, User2,...) to be assigned to that selected Assignment (AssignmentNo 5). AND then somewhere and somehow each selected user has to be given a percentage of the assignment (i.e. User1 to be given 80%, User2 to be given 20%) of AssignmentNo 5. Later on the manager may want to add User3 to the same assignment and to give the user3 10% of AssignmnetNo 5.
Please note that there is no need to limit the percentages to add up to 100%.
I can select the users from the listbox but not sure how to design the interface to allocate percentages for each user.
Thanks
|
|
|
|
|
a solution can be like, while entering the assignment into the system, also get the questions in that assignment to store them.
so when the assignment will be divided into two or three different users in percentages, get the percentage based on the number of questions and then divide the assignment according to no of questions. like of u have 10 questions in an assignment, 80% will b 8 questions and 20% will be 2 questions. so then u can assign user1, 80% of the assignment, and user2 20% of the assignment.
Regards
Saqib
sAqIb
"Our scientific power has outrun our spiritual power. We have guided missiles and misguided men."
Dr. Martin Luther King Jr.
|
|
|
|
|
I am using the Datagrid form control in C#.net environment. I have no problem binding the datagrid to the datasource and displaying the table I want to display. But I am having a problem changing some of the grid elements using code after I have displayed the control.
For example, there are some columns that need the width changed. I have not been able to change any of the grid elements/properties at all.
Here is the code that displays the grid and its data:
------------------------------------------------------------------------------
DataSet aDataSet = new DataSet();
OleDbDataAdapter aAdaptor;
aSqlQuery = "SELECT * From Employee";
aConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;User ID='Admin';Data Source=CSharpDataGrid.mdb;";
aConnection = new OleDbConnection(aConnectionString);
aAdaptor = new OleDbDataAdapter(aSqlQuery, aConnection);
aAdaptor.Fill(aDataSet);
this.dgEmployee.DataSource = aDataSet.Tables[0];
--------------------------------------------------------------------------
As I said, this code brings up the control with the data loaded. Now I am trying to change the width of one column:
--------------------------------------------------------------------------
DataGridTableStyle EmployeeTableStyle = new DataGridTableStyle();
EmployeeTableStyle.MappingName = "Employee";
DataGridColumnStyle ColumnFullName = new DataGridTextBoxColumn();
ColumnFullName.MappingName = "Name";
ColumnFullName.HeaderText = "Full Name";
ColumnFullName.Width = 5;
EmployeeTableStyle.GridColumnStyles.Add(ColumnFullName);
-----------------------------------------------------------------------
This code has no effect on the displayed grid. I would expect the DataGridTableStyle to be associated with the Employee table in the grid dataset. And then I would expect the column “Name” would change as per the above code. But nothing happens.
Would appreciate any tips on how to change row and column properties (width, color, selection status, etc) using C# code.
Thanks, Vern
Vern
|
|
|
|
|
hi,
the default name of your table in aDataSet is 'Table'. this should match with your EmployeeTableStyle.MappingName which is 'Employee'.
set the aDataSet.Tables[0].TableName='Employee'.
if you are not skipping any code, then add styles in following order and THEN BIND.
DataGridColumnsStyle(s) --> DataGridTableStyle --> TableStyles
regards
|
|
|
|
|
You really identified the problem. Once I set the aDataSet table name to "Employee", everything suddenly works.
I spent days working on this problem and got so frustrated. I am so thankful for your tip. Such a little detail can make such a difference.
Thanks again for your help.
Vern
|
|
|
|
|
I'am developing a sticker printing software. In my company we have printer with both COM and LPT port. So my software must support both.
For printing,
I create FileHandle to send data to printer. This method works both COM and LPT but I can't learn if printer finished its job.
with this methot printer gives overflow error when I try to print more than 50 sticker.
My code like this...
public const Int32 GENERIC_READ = -2147483648;
public const Int32 GENERIC_WRITE = 1073741824;
public const Int32 OPEN_EXISTING = 3;
public const Int32 FILE_ATTRIBUTE_NORMAL = 128;
public const Int32 NOPARITY = 0;
public const Int32 ONESTOPBIT = 0;
[DllImport ("kernel32", SetLastError = true)]
public static extern IntPtr CreateFile (string lpFileName, Int32 dwDesiredAccess, Int32 dwShareMode,IntPtr lpSecurityAttributes, Int32 dwCreationDisposition,Int32 dwFlagsAndAttributes, IntPtr hTemplateFile);
string port = ""// LPT or COM
IntPtr hParallelPort = CreateFile (port, GENERIC_READ | ENERIC_WRITE, 0, IntPtr.Zero, OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL, IntPtr.Zero);
FileStream stream = new FileStream (hParallelPort, FileAccess .ReadWrite);
with this I'am send data to printer over LPT or COM
stream.Write(file);
|
|
|
|
|
Actually i have made one application in C# for importing .CSV file.
My program takes file and put all data from .CSV file to database.
It is working properly on localhost,but when i run that on server it gives me error that unable to find taht path of that selected file
what can be the problem?
i am unable to find that one
Please help me
Jayraj
|
|
|
|
|
Does the application get the full path of the file or does it use some kind of relative path. Can you show the code where you open the file for reading? That might help finding the cause of your trouble.
WM.
What about weapons of mass-construction?
"You can always try to smash it with a wrench to fix that. It might actually work" - WillemM
|
|
|
|
|
hi All
I am create Qurey like " SELECT c_EmpFName As Name,c_EmpCode As Code, c_CardCode As CardCode, c_BankName AS BankName ,c_AccountNo AS ACNO, c_qualification AS Qual FROM dbo.t_EMPINFO WHERE (c_Softdelete = '1') ";
and Excute by using "OleDbDataAdapter" and fill the DataSet Object "ds"
now i want to bind this ds to crystal report object how can do it
Is any one Help me !!!!
thank !!
|
|
|
|
|
ReportDocument doc = new ReportDocument();<br />
doc.Load(...);<br />
doc.SetDataSource(ds);
Here ya go.
WM.
What about weapons of mass-construction?
"You can always try to smash it with a wrench to fix that. It might actually work" - WillemM
|
|
|
|
|
Hi
I have a problem of binding a arraylist to a data table. Could you help me please?
ArrayList aList=new ArrayList();
aList.Add("Value1");
aList.Add("Value2");
aList.Add("Value3");
aList.Add("Value4");
I wannt to bind the aList value to a data table in c#. How to do please?
kesavan
|
|
|
|
|
create object of arraylist
ArrayList aList=new ArrayList();
then fill the Arraylist and finally create one object of datatable
and then give the DatSource as Arraylist object ( i.e. aList) and then bind it refer below code;
datatableobject.DataSource = aList;
datatableobject.DataBind();
It will be work !!!!!!!1
|
|
|
|
|
Hi guys,
I think I need some serious painkillers on this!
Short version:
Can anybody explain in details how to expose a C# WinForms Control as ActiveX control. Either via hosting it in a MFC ActiveX control or by implementing it completely in C# (implementing all interfaces, registration/unregistration stuff, events).
Perhaps somebody has a template project for this problem where I just can drop in my Windows Forms Control and is willing to share it with me and the others (sounds like XMas, I know).
Bloody details:
We have a large client application with lots of legacy code that implements an ActiveX container. So you can add e.g. GUI components by providing new ActiveX controls. Since we have almost year 2007 we want to develop new GUI components with Windows Forms instead of the existing MFC/OWL stuff (yes! OWL! ). We recently migrated to Visual Studio 2005 (.NET 2.0).
As far as I can see there are 2 main approaches:
(Approach 1) Use of a MFC ActiveX control for hosting the Windows Forms control and use the new MFC 8.0 template classes CWinFormsDialog[^] or CWinFormsView[^] for adding the WinForms control to a CDialog/CView.
(Approach 2) Implement all necessary COM interfaces completely in C# and make them visible to COM and do the extra COM registration/unregistration stuff as explained here[^]. So the resulting component would be completely written in C# with no other languages involved. Furthermore we have about half a dozen COM interfaces for communication between the client and the ActiveX component. These interfaces must be implemented too. Sounds like very much more work than approach one.
So we decided to follow approach one - hosting a WinForms control within a MFC ActiveX control. What a pain until now!
This is what we did (following the MSDN examples[^]):
(1) Created an "empty" MFC ActiveX control, with all of our COM interfaces, showing an empty CDialog. Works flawlessly when added to the client application or to the ActiveX Control Test Container.
(2) Enabled Common Language Runtime Support (/clr) for the project. After fixing some compiler warnings the project compiles fine to MSIL.
( #1) Here is already the first major problem: When the project is started after '/clr' is activated, Visual Studio 2005 locks up completely while loading the CLR DLLs (e.g. 'mscoree.dll', 'mscorwks.dll'). There is no error message or crash, but VS2005 hangs infinitely and the only thing to do is killing the 'devenv.exe' process. Why is this? But it's possible to start the application regularly! Only when started via VS2005 it hangs. The ActiveX still shows up correctly when the application is not launched via VS2005.
(3) Since I found no solution for this problem I sighed and added a CWinFormsControl member to the "empty" CDialog as described in the MSDN example here[^] (which works by the way perfectly when used in a stand alone dialog application). I tried two variants:
CWinFormsControl<WinFormsCtrl::UserControl1> m_WinFormsCtrl;
CWinFormsControl<System::Windows::Forms::LinkLabel> m_WinFormsCtrl; The result was the same in both cases:
( #2) When the ActiveX is about to be displayed it crashes in 'CWinFormsControl<TManagedControl>::InternalCreateManagedControl' (<VS2005-install-path>\vc\atlmfc\include\afxwinforms.inl). Output window says: A first chance exception of type 'System.AccessViolationException' occurred in <MyActiveX>.OCX
I got this information by attaching to the application process with VS2005 when the application is already running.
I read several threads where members of the Visual Studio Team and MVP's are saying that MFC 7.1/8.0 are officially supported unmanaged hosts for Windows Forms controls, just like Internet Explorer. But it seems not to apply for MFC ActiveX controls!?
P.S.: I already tried it in the C++/CLI board but got no answer at all.
cheers,
mykel
If they give you lined paper, write the other way!
|
|
|
|
|
C'mon... doesn't anybody have experience with hosting WinForms controls inside MFC ActiveX controls?
There must be lots of large "legacy" applications out there which implement an ActiveX container for (GUI) extensions.
Any help is appreciated, even comments like "Careful, you'll likely get burned using this approach, because ..."
cheers,
mykel
If they give you lined paper, write the other way!
|
|
|
|
|
How Can iu have a Msi file with Unicode text like سس is it possible ??
MHF
|
|
|
|
|
how can i write the code for barcode reader to scan the
barcode so that i use that barcode in my application
|
|
|
|
|
yousafzai wrote: how can i write the code for barcode reader to scan the
barcode so that i use that barcode in my application
I'm sure the barcode reader will have a well documented API - you should read that documentation. The vast majority of people here probably don't know anything about barcode reader. The manufacturer of the reader will probably have a forum where you can ask if you are still stuck.
|
|
|
|
|
hi,
any barcode reader device will read only 'valid' barcodes. a barcode is valid only if it satisfies a criteria. please look on the internet for differnet barcode standards like EAN8 (8 digits), EAN13 (13 digits), UPC-A (12 ditits),UPC-E (8?) etc. as long as its valid and readable, it will be read by any scanner and scanner will transmit data to your host just like keyboard. please note that scanners normally automatically transmit EnterKey char at end of barcode.
regards.
|
|
|
|
|
I think you should respond to the OP rather than me. I think he'd prefer the information.
|
|
|
|
|
I’m studying computer programming, and I’m a little puzzled by the Composite design pattern.
In "Design Patterns in C#" by Steven John Metsker, Addison-Wesley, it says: COMPOSITE lets clients treat individual objects and compositions of objects uniformly.
And in "Programming C#", O'Reilly, it says about polymorphism: Thus, polymorphism refers to being able to use many forms of a type without regards to the details.
Is this not one and the same thing?
Programming is like Mathematics… you take ONE step at the time!
|
|
|
|
|
Polymorphism is one pillar of the OOP paradigm.
Composite is a design pattern, i.e. a very good solution to a well known problem.
I think you have to learn more about both OOP and design pattern techniques.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Polymorphism: being able to treat a car as an vehicle - using a base class reference to call virtual methods.
Composite: making a car of individual parts (motor etc.) and being able to treat both the motor and the whole car the same, e.g. calling Repair() on them.
The Composite pattern uses polymorphism (as most design patterns do), but it isn't the same thing.
|
|
|
|