|
so I have a DateTimePicker that currently is set to show time only.
right now when the user clicks on the drop down button it shows the calendar.
I need a method to only show time or disable the dropdown event from happening so not to show calendar
this control I need it for Time Selection only//
Any Ideas?
Thanks in advance
|
|
|
|
|
There are two properties which have to be set to achieve your aim
1) ShowUpDown = true will disable the drop down calendar
2) Format = DateTimePickerFormat.Time will removes the date component of the display
Alan.
|
|
|
|
|
ShowUpdown Property True
and Custome Format set hh:mm:ss:tt
|
|
|
|
|
We're having an issue with our project. Our software switches back and forth between a GPS software and our program. We have a button that we want to paint over the GPS software. The purpose of this button is to navigate back to our actual program from the GPS software. However, we're having some issues with painting and the two applications fighting for a top most position. When we try to give our button a top most position, it keeps having its LostFocus event called, which makes me believe that the two are indeed fighting for top position. Assuming this is true, what would be the best way to go about restricting the GPS window from having the top most position?
Thanks ahead of time.
-Brandon
|
|
|
|
|
Don't try to have anything on top of something else. Think of a better way to achieve what you want.
|
|
|
|
|
Hi,
when i am binding datatable to datagridview, it is not showing all the records in the datagridview..
it is displaying only 1 Record in datagridview..
actual records in datatable are 12.
have any idea,let me know..
here is my code
public static DataTable dtable = new DataTable();
private void ScheduledJobs_Load(object sender, EventArgs e)
{
try
{
FillGrid();
if (dtable.Rows.Count > 0)
{
dgrid.DataSource = dtable;
}
}
catch { }
}
private void FillGrid()
{
try
{
if (dtable.Rows.Count == 0)
{
ProcessStartInfo ps = new ProcessStartInfo("SCHTASKS", "/QUERY /fo table");
ps.RedirectStandardOutput = true;
ps.UseShellExecute = false;
Process p = Process.Start(ps);
p.OutputDataReceived += new DataReceivedEventHandler(p_OutputDataReceived);
p.BeginOutputReadLine();
}
}
catch { }
}
System.Collections.ArrayList ar = new System.Collections.ArrayList();
int first = 0;
void p_OutputDataReceived(object sender, DataReceivedEventArgs e)
{
try
{
if (first == 0 && dtable.Columns.Count == 0)
{
dtable.Columns.Add("Task Name");
dtable.Columns.Add("Next RunTime");
dtable.Columns.Add("Status");
}
ar.Add(e.Data);
if (first > 2 && ar[first] != null)
{
DataRow dr = dtable.NewRow();
dr[0] = ar[first].ToString().Substring(0, ar[first].ToString().IndexOf(':') - 2).Trim();
dr[1] = ar[first].ToString().Substring(ar[first].ToString().IndexOf(':') - 2, 20).Trim();
dr[2] = ar[first].ToString().Substring(ar[first].ToString().IndexOf(':') + 18).Trim();
dtable.Rows.Add(dr);
}
first++;
}
catch { }
}
Thanks in advance.
Pawan.
|
|
|
|
|
I am surprised there are any rows in the grid at all. You never call DataBind(). When you step through the code int he debugger with a watch on dtable.Rows.Count and a breakpoint at dgrid.DataSource = dtable;
are you sure it says 12? Or are you just assuming there should be 12 records when it gets to that point?
|
|
|
|
|
hi
before posting this question only i checked all the above things which u said.
it is showing perfect 12 records dtable.rows.count in immediate window
when i am binding the same to Datagridview also, the dgrid.rows.count is 12 only..
but it is not showing the 12 records in grid, instead of 12 it displays only 1 record..
Let me know if u have any solution..
Thanks and Regards,
Pawan.
|
|
|
|
|
how i can use Assembly code in C# ?
|
|
|
|
|
shahramkeyboard wrote: how i can use Assembly code in C# ?
That depends largely on what you mean with "assembly code";
- If it's code that's stored in an assembly, then simply load it.
- Assembly might also refer to IL, which is explained here[^]. That's specific to the .NET VM.
- If you're referring to plain old assembler, then I'd suggest you install Turbo Pascal.
I are Troll
|
|
|
|
|
You can't directly. .NET uses a form of intermediate language which is intended to be target neutral. If you want to use assembly code, you need to look at writing your application either in assembly, or in C/C++. .NET is entirely the wrong choice here.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Yeah, can't be done directly, but I would guess it can be done. Create a C++ project that uses "__asm {...}", reference that project from a managed C++ project, then reference that project from a C# project. Might have to mark some functions as "unsafe" or something, but I would guess something like that would work.
|
|
|
|
|
Wouldn't there be a more direct way? Such as doing the __asm part in C++/CLI and merging it with the compiled C# with ILMerge? (would that work?)
|
|
|
|
|
I thought ILMerge only worked for IL assemblies. C++ with assembly code would compile directly to machine code. Would ILMerge still work then? And even if it did work then, I don't understand how that would make things more direct than creating a few projects and having a couple references in Visual Studio.
|
|
|
|
|
That's why I was planning C++/CLI, it makes mixed assemblies right?
At the very least, mixed assemblies exist in the wild, even though I'm not sure how they were made..
|
|
|
|
|
I suggest you stop trying to write your piece of malware (which is really the only thing it can be, if you want to disable interrupts)
|
|
|
|
|
Why in the world do you think the OP is creating malware or is trying to disable interrupts? Did the OP modify the question, because I don't see any mention of disabling interrupts. There are many uses for assembly language in higher level languages, usually relating to performance. For example, at the bottom of my SlimList article, I mention that I can use BSR (an assembly command) to do a quicker base 2 integer log calculation than would be possible using plain C#.
|
|
|
|
|
Did you miss this[^]?
Maybe you where occupied in darker areas?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Luc Pattyn wrote: Did you miss this[^]?
Yep.
Luc Pattyn wrote: Maybe you where occupied in darker areas?
QuickAnswers... a dark place indeed.
|
|
|
|
|
yes it can be done using c++ project wrapper then you would add reference to that dll into .net ,
but be careful , when you do so , you lose the portability that microsoft struggles for when it creates .NET technology , it can't be run on different OS because your embedded assembly code will be targetted for specific platform .
Requirements to create the c++ wrapper dll
1 - Decorate the method in c++ as "extern" to stop the compiler from changing the method name when you compile your DLL .
2 - you can even call the dll methods without using unsafe declaration , because it will be treated like any dll referenced in .NET project.
i hope this helps
Human knowledge belongs to the world.
|
|
|
|
|
Strictly speaking, you can't as others have said.
However this thread[^] says that you can use simple assembler instructions inline. WARNING You have to register to download the code. No personal details are required though.
I also doubt that it compiles down to a binary file, don't know because I haven't looked at it myself yet. Still it might be fun even if not actually useful.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
|
How can I write sql sentence with byte[] parameter?
NOTE: I don't want to use SqlParameter.
string sql = "INSERT INTO MyFile(FileId, BinaryFile) VALUES('" + fileId + "','" + file + "')";
....
command.ExecuteNonQuery();
fieldId is int variable, file is byte[] variable.
In database; FileId is int field, file is varbinary(MAX) field.
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:29am.
|
|
|
|
|
I don't want to use SQL Parameter. I use MS SQL.
|
|
|
|