| How to draw a one pixel line |
|
 |
Index ‹ DotNet ‹ Dotnet
|
- Previous
- 1
- 2
- Microsoft Project >> Resource displayWould it be possible to display resources in different columns, depending on
the resource group?
Could I generate a report showing the different columns and tasks?
- 3
- Winforms >> Custom DataGridView Columns and CellsHi,
I have an application with a DataGridView that displays a Questionnaires
questions and allows a user to fill in answers to these questions in the
gridview.
Each question knows its questionType (Date, Text, or Yes/No/Na). I have
created a custom column that inherits from datagridviewcolumn and have
created a custom cell that inherits from DataGridViewTextBoxCell.
In my cell object, I get the OwningRow.DataBoundItem to reference the
QuestionObject and then Get the QuestionType of the question in that row.
After I do this, I use a select case statement to determine the type of
editing control I need for Edit purposes. This way, Date questions get a
datepicker edit control, YES/NO/NA questions get a combobox edit control and
Text questions get a text box edit control.
I have my DataGridView displaying the correct type of editing controls when
edit mode is entered on the cell. And my Text Box and DatePicker Edit
controls seem to be working right as well.
I am having a problem with the ComboBox edit control for my custom cell.
Even though I specify the Items list for the combobox, when the combobox is
displayed, none of the items show up in the dropdown and even if I type an
answer in the combobox, it doesn't enter edit mode.
There are also some other strange behaviors going on in terms of values
displayed when entering edit modes and in display mode.
I would really appreciate any help here I can get. This has been a big
problem for me to solve and have gotten close, but not yet complete.
Thanks so much in advance for your help.
Guy
- 4
- Dotnet >> How do I build the project sample to detect and install CFHello friends
I have got a sample code from msdn in the following link.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfdepl.asp
but i am not understanding how to build this project and how to get the .msi
file to start the setup.
if u know please help.
with regards
Meghna
- 5
- 6
- 7
- Visual C#.Net >> C# property usage questionHi,
I'm new to C#. Most examples about properties I found are sth like the
following:
class A{
private int property;
public int Property {
get { return property; }
set { property = value; }
}
}
My question is, Can I simply do the following:
class A {
public int Property;
}
Then later, if it turns out that I need to do sth when the property is set
or get, I change it to
class A{
public int Property {
get { <do sth>; return ... }
set { <do sth>; }
}
}
This way, the code that uses A should still compile. Am I right? This way
sounds much simpler to me, you don't have to write those repetitive get&set
unless you later find out that you need. Is this the right way of using
properties? Am I missing sth here?
thanks
vh
- 8
- Dotnet >> Using ServicePointManagerIs the object global? I would like to ignore ftp server certificate validity
making connection to it in one part of my application. Will it apply the
validation bypass to this thread, process or whole .net platform?
- 9
- 10
- Visual C#.Net >> Layout manager issue when docking panels?I was playing around with a new Windows form yesterday. I wanted to drop two
panels on the form. The first would be set Dock=Top. The second would be set
Dock=Fill.
So, I dropped the first panel and set its Dock property to Top. I then dropped
the second panel on the form and set its Dock property to Fill.
Holy disappearing panels, Batman. The second panel filled the entire form
hiding the first panel. So, when I dropped my grid control on the second panel
which was set to Dock=Fill, it filled the entire screen.
I eventually got what I needed by cutting and pasting the controls, which was a
suggestion of a fellow developer at work, but it was a bit annoying.
Is there a bug in the layout manager in the forms designer that is causing this
behavior?
- 11
- Dotnet >> Can not change application iconA VC.net application, the 3 16777216-color icons, 16*16,
32*32 and 48*48, have been modified, but after rebuild the
application, the icon does not change. Should we modify
anything else to change the icon?
- 12
- Net Framework >> Delegates and InterfacesI have a dilemma that I'm having a tough time getting through on a VB
2005 issue. I have a custom control for a form to display data from a
windows form. Right now, the main form calls various web service
methods in order to update the data. Since the data to be displayed
depends on the call to the web service, I use a delegate that will
invoke the method when a timer elapses. Works good for now but I want
to create additional custom controls that will display data and have
the main form cycle through the controls. Because of this, I figured
that it would be easier to implement an interface on the custom
control so that the form can instantiate the controls dynamically as
it cycles through.
So here's my dilemma. The control (or controls) could call various
methods to get a "data refresh". Therefore, I wanted to give the
control the delegate to invoke within itself as the main form cycles
through each control on a separate timer. But how do I do that using
an interface? I can't have the delegate on the interface because its
a type. I can't pass in the signature to the c'tor because it's not a
type. What options do I have?
I appreciate any help anyone can give.
- 13
- Net Framework >> Memory leakage!!Please look at the following URL:
http://forums.devbox.net/showthread.php?p=3082#post3082
Can anyone suggest me the solution to this?
Thanks a lot!!
- 14
- Visual C#.Net >> Order of Columns in the Datagrid binding.Hi, Dear gurus,
I want to bind my collection to a datagrid. The field names in my object
show up in a weird order, and I just wonder how I could reorder those
columns .
I find some code like the following , but I don't want to do it that way
because it won't work if I have large number of fields.
[
DataGridTableStyle myGridStyle = new DataGridTableStyle();
myGridStyle.MappingName = "GridTableMappingName";
DataGridTextBoxColumn nameColumnStyle = new DataGridTextBoxColumn();
nameColumnStyle.MappingName = "GridColumnMappingName";
nameColumnStyle.HeaderText= "GridColumnMappingName";
myGridStyle.GridColumnStyles.Add(nameColumnStyle);
myDataGrid.TableStyles.Add(myGridStyle);
]
I believe there must be some better way to do that(using reflection) .
Anybody gives me some hint on that. A link to a example is highly
appreciated.
Thanks,
J.W.
- 15
- Microsoft Project >> Changing resource calendar with a 24 hour project calendarWe have a project that is set up with a 24 hour calendar and resources that
are allocated either to a 24 hour or a 12 hour calendar. If we change a
task with a 24 hour resource calendar to a 12 hour resource calendar, the
task still showed as the resource working through the night as if they were
on the 24 hr calendar.
The task is a fixed unit task.
By doing this, our critical path also changes - any ideas why?
Thanks
|
| Author |
Message |
IllyaTeideman

|
Posted: Tue Aug 01 08:16:05 CDT 2006 |
Top |
Dotnet >> How to draw a one pixel line
I want draw a line for saperate form, how do i do?
thx
DotNet306
|
| |
|
| |
 |
Angelina

|
Posted: Tue Aug 01 08:16:05 CDT 2006 |
Top |
Dotnet >> How to draw a one pixel line
Just override the onpaint event of your form and write down :
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
g.DrawLine(new Pen(Color.Black), x1, y1, x2, y2);
//x1, y1 is start point and x2, y2 is end point of the line
base.OnPaint (e);
}
cheers ;)
- Angelina
"Sonic" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
>I want draw a line for saperate form, how do i do?
>
> thx
|
| |
|
| |
 |
| |
 |
Index ‹ DotNet ‹ Dotnet |
- Next
- 1
- Visual C#.Net >> Creating Control panel applets using C#I have to create a control panel applet for my project using C# . But
i got to know that it is not possible using C# since dll has to
export static entry points. And one of the ways is using MC++ to write
a wrapper for the C# component.
as we know that .NET languages all are based on a common library ie
CLR. I do not see any reason why Managed C++ can work with C++.NET not
C#.NET. Could you please let me know why is this the case, or have i
got it wrong.. .
Pease clarify
Thanks
Rajani
- 2
- Visual C#.Net >> Parameterized Query unexplainably slowHi,
I came across a very weird problem. I get a statement from a file, dump
the text into a sql command, add a sql parameter and run the query.
This lasts about 1 1/2 hours, compared to 2-3 minutes running the same
statement from within the sql query analyzer.
To get around this problem I added the following lines INTO the
statement file:
declare @param int
set @param = 20060411
using this, the statement lasts 2-3 minutes.
When using s sql parameter with the sql command the same statement
needs 1 1/2 hours. I added the parameter as follows:
cmd.Parameters.Add("@FromDate_SID", date.ToString(("yyyyMMdd")));
or
cmd.Parameters.Add("@FromDate_SID",
Convert.ToInt(date.ToString(("yyyyMMdd"))));
Both result in a duration of 1 1/2 hours.
Does anyone can give me a clue on this? I'm lost, and I am running out
of ideas.
Thanks in advance
Michael
- 3
- Visual C#.Net >> accesing Form1:controls from other classHello
I have Form1 : System.Windows.Forms.Form and some public controls in it:
public System.Windows.Forms.ComboBox comboBox1;
public System.Windows.Forms.ComboBox comboBox2;
in the same project i have some other files with some otherclasses.
Can i access any of theese controls from that other classes ?
How ?
Thanx
- 4
- Microsoft Project >> VB Macro for this dummy .. another outlook-project sync question.I have tried to get Maurice's script (ms project - outlook calendar) to work
but I keep getting an "object not found" error, Maurice, can you give this
dummy a step by step on how to set this script up as a macro and what
pitfalls one might run into while doing so?
I have seen a couple posts about using the workgroup mail feature for being
able to send email project reports directly from project. Should I be setting
up the workgroup mail stuff in project 2007? Is there a new way to
accomplish this within 2007 without the workgroup mail work a round?
Honestly, after playing with project 2007 most of the day, reading ALOT of
the posts here in the newsgroups, I can't believe there is still no way to
sync tasks, mail and calendars between MS Project and Outlook. I wish
Microsoft could understand that some of us (small time consultants) just
don't have the money to purchase all the bells and whistles needed to
accomplish these tasks and that maybe they should make it feasible for us to
get the type of functionality that we need to do our small jobs in a big
world wide web =D
- 5
- 6
- ADO >> Sql Statement ErrorsHi Group,
Hope somebody could help? I have a table called ArcirisUsers which has a
field called SITES. I would like this field to pull a list of sites from the
Site feild in my SITES table. I have created the following SQL stement:
SELECT ArcirisUsers.Usersname, ArcirisUsers.POSID,
ArcirisUsers.POSAccess, ArcirisUsers.[Password], ArcirisUsers.LiveDate,
ArcirisUsers.BomID,
ArcirisUsers.BomAcc, ArcirisUsers.ArcirisUsersID,
Sites.[Site Name]
FROM ArcirisUsers INNER JOIN
Sites ON ArcirisUsers.PrimarySiteID = Sites.SitesID
However when I try and run this it comes back with a error saying "No Value
Given For One Or More Parameters"
When I try and create the above in my DataAdapter Wizard it comes back
telling me "Cannot Get DataScheme" Which I assume is because the SQL query
is
wrong?
Could anybody please Point me in the right Direction?
Regards
Si
- 7
- 8
- 9
- Microsoft Project >> Progress reportHI,
This should be pretty easy but I can't figure how to do it. I need a way to
create a report that shows the progress from a given status date...I need to
know what the remaining work is and what the remaining work should be a the
given point. I would like it in a table format, not the graphical
representation in the Gantt. Any suggestions?
- 10
- Dotnet >> Postback problem with web partsIs there anyway to prevent a postback event when a web part is moved into a
different zone? I am using the MSNBC weather web part and it fires a java
script which is causing an error because the page is posting back.
Thanks in advance,
Vince
- 11
- Dotnet >> Connecting to a WCF Service hosted in a Windows ServiceI have written a simple WCF service hosted in a Windows console application
and a simple WCF client console application that connects successfully to
that service and retrieves data. I then ported the console application to
WinForms and also got that to work properly.
My next move was to host the WCF service in a Windows service application. I
believe I have that working correctly, but I can't for the life of me get a
client to connect to the service. I did not use svcutil to generate proxy
code for the client, but instead relied on using a ChannelFactory to
instantiate my client connection to the service.
Here's the client code:
namespace MyClient
{
public partial class MainForm : Form
{
private IMyService service;
public MainForm()
{
InitializeComponent();
try
{
ChannelFactory<IMyService> factory = new
ChannelFactory<IMyService>("MyService");
service = factory.CreateChannel();
string myData = service.GetMyData();
MessageBox.Show(myData);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + ex.StackTrace);
}
}
}
}
Here's the client app.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<client>
<endpoint address="net.tcp://localhost:12345/MyService/service"
binding="netTcpBinding"
contract="Contracts.IMyService"
name="MyService">
</endpoint>
</client>
</system.serviceModel>
</configuration>
Here's the server app.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="MyService">
<host>
<baseAddresses>
<add
baseAddress="net.tcp://localhost:12345/MyService/service"/>
</baseAddresses>
</host>
<endpoint address=""
binding="netTcpBinding"
contract="Contracts.IMyService">
</endpoint>
<endpoint address="mex"
binding="mexTcpBinding"
contract="IMetadataExchange">
</endpoint>
</service>
</services>
</system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="metadataSupport">
<serviceMetadata>
</serviceMetadata>
</behavior>
</serviceBehaviors>
</behaviors>
</configuration>
Here's the contract code:
namespace Contracts
{
[ServiceContract]
public interface IMyService
{
[OperationContract]
string GetMyData();
}
}
I get the following exception when invoking the service.GetMyData() method:
Could not connect to net.tcp://localhost:12345/MyService/service. The
connection attempt lasted for a time span of 00:00:00.9843813. TCP error code
10061: No connection could be made because the target machine actively
refused it.
Server stack trace:
at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri
uri, TimeSpan timeout)
at System.ServiceModel.Channels.BufferedConnectionInitiator.Connect(Uri
uri, TimeSpan timeout)
at
System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
at
System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at
System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel
channel, TimeSpan timeout)
at
System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan
timeout, CallOnceManager cascade)
at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan
timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action,
Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs,
TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action,
Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at
System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage
message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at Contracts.IMyService.GetMyData()
at WinClient.MainForm.GetMyData() in C:\Documents and Settings\adrian\My
Documents\Visual Studio 2005\Projects\WCFTest\WinClient\MainForm.cs:line 54
This is my first attempt at using WCF. Any help would be greatly appreciated.
- 12
- Visual C#.Net >> C # and C ++ learning curveHi Complete ass here trying to get his feet wet in .NET programming. I want
to start easy, understanding what is talked about. Which of these two would
be a better choice, if same, which one is consider easier to learn first?
Thanks for any advice
- 13
- Net Framework >> Is there any predefined delegate with no argument?Hi,
I am looking for a predefined delegate which in form:
delegate void NoArgument();
It's quite useful than other delegate with argument, I found
MethodInvoker in WinForms, which defined in such form, but I don't
want to add WinForm reference all the time, since my code nothing
relative the WinForm.
The reason why I use no argument delegate is quite often is that it's
quite easy to access local variable if I use anonymous methods, which
may decrease the prerequest of declare a delegate with some argument
to pass in.
For example, when I try to access WinForm in thread safe way, I
defined a static function DoThreadSafe():
private static void DoThreadSafe(Control control,
MethodInvoker function)
{
if (function != null)
{
if (control.InvokeRequired)
{
control.Invoke(function);
}
else
{
function();
}
}
}
When I use it, I do not need any parameter to pass to the "function",
such as:
value = 123;
DoThreadSafe(progressBar1, delegate
{
progressBar1.Value = value;
});
It is really easy to access the variable which is accessible in
current scope. I found many such cases which treat the delegate just a
block of code to execute without any need of argument.
I think that it's better to treat void delegate with no argument as a
special, and predefined in dotnet framework, and may be more
convinient to declare and call in the future version of C#. Is there
any existing delegate in .net framework?
Regards,
- 14
- Microsoft Project >> Exporting a report to ExcelHello all
what I am attempting to do is export a "Cash Flow" report from Project(2003)
to Excel (2003). I don't want or need the whole Project file exported to
Excel.
I had expected that I would at least be able to print the report as a
delineated text file but I cannot find the options to do this or to export
the report using some other method.
Can anyone help please?
Regards
Jack
- 15
|
|
|