|
I have setup an application which initial WindowState is "Maximized". But unfortunately, the bottom has been hidden by the system taskbar. So how can I change the size of the window, so that both the taskbar and my application can be shown without any interference.
|
|
|
|
|
Hi, try to right click at your taskbar then select or click the "Lock the Taskbar"
Hope this one can help
Thanks
|
|
|
|
|
Thanks.
But mine is an application, which should deal with different cases of taskbars.
|
|
|
|
|
I'm sending a quary to sql database.I have tryed this whit DataReader, DataAdapter and BindingSources.I'm adding the data returned from the quary to a list box.So far everything is ok.But I can't add an item from the listBox I filled with DataAdepter or Reader.
When I tried DataReader selectedItem and SelectedIndex of listBox gets Null value.
When I tried DataAdapter and DataSet selectedItem of listBox gets System.DataRow.View or something like that I cant remember the full text now.
I tried every way that I found in internet to grab data from a sql data base.
Is there anyone can explain this??
|
|
|
|
|
Based on the code below, how do I dynamically create a Gake.Orchard.Business.PageContent object in the Gake.Data.Base.DataCollection.Retrieve method?
Below is "working" code; however, I don't think I should be explicitly passing in "typeof(typePageContent)", in order to get it to work. I believe I should be able to get that from "typDataObject". The syntax that I'd like to use, is commented out; however, the line "typDataObject typObj = new typDataObject();" created Gake.Orchard.Data.PageContent, when I need it to create Gake.Orchard.Business.PageContent.
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
PageContentCollection pcc = new PageContentCollection(2,this.GetType().Name);
}
}
namespace Gake.Orchard.Business
{
public class PageContentCollection : Gake.Orchard.Data.PageContentCollection<pagecontent>
{
}
}
namespace Gake.Orchard.Data
{
public abstract class PageContentCollection<typpagecontent> : Gake.Data.Base.DataCollection<pagecontent> where typPageContent : PageContent
{
public PageContentCollection(int Panel, string Page)
{
DataResult result = base.Retrieve(typeof(typPageContent), "Panel = @1 and Page = @2", Panel, Page);
}
}
}
namespace Gake.Data.Base
{
public abstract class DataCollection<typdataobject> : CollectionBase where typDataObject : DataObject
{
public DataResult Retrieve(Type TypeOfChild, string Conditions, params object[] Values)
{
Object objChild = Activator.CreateInstance(TypeOfChild);
}
}
}</typdataobject></pagecontent></typpagecontent></pagecontent>
|
|
|
|
|
I want to make my program invisible in the task manager while it runs some background functions to later be returned to the visible state in the task manager, since I don't want the user to kill the process while it is still working.
I know there is a project already on here somewhere which runs in the system tray and lists all processes and has a button that can make a process invisible to the task manager but I don't remember the link to it on this site.
|
|
|
|
|
Imposible to hide process. You can hide window, But not process.
|
|
|
|
|
If someone kills your process, they are on their own. And no, you can't hide it.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
I'm 100% sure it can be done because I have done it before in C# but don't have the full code but it has something to do with using APIs and sending a message to the process ID which causes it to be hidden in the task manager, here is the c++ project:
Driver to Hide Processes and Files[^]
|
|
|
|
|
OK, you can hook the process that enumerates processes ? Interesting...
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
You can do that I believe but the last time I simply used SendMessage to the process with a special code and it made it invisible. I know the code was published somewhere but I still can't find it.
|
|
|
|
|
Good luck with that. There is no legitimate reason to do that.
|
|
|
|
|
I can't find it in C#, but you might be able to port this from VB... Good luck.
|
|
|
|
|
|
Hi all,
I want to populate a Hashset with a series of objects then perfom operations such as intersects and excepts but not on the objects contained within the hashset as a whole, rather a peroperty of the object.
So for example:
Hashset<person> allPeople = new Hashset<person>(){
new Person { name="Tom", age=22, eyeColour="blue" },
new Person { name="James", age=32, eyeColour="brown" },
new Person { name="Mark", age=25, eyeColour="brown" }
};
A hashet of "Person" objects that I then wish to compare against another hashset. The catch is though that I dont want the objects to have to be the same. So another hashset:
Hashset<person> brownEyedPeople = new Hashset<person>(){
new Person { name="Jake", age=35, eyeColour="brown" },
new Person { name="Sam", age=44, eyeColour="brown" }
};
I then want to do an intersect so "allPeople.Intersect(brownEyedPeople)" but only on the property "eyeColour". So effectively it would remove James and Mark from the first hashset.
I hope that all made sense, I've been trying to find examples but havent been able to yet.
Cheers.
|
|
|
|
|
daviiie wrote: I hope that all made sense,
Not quite, how can allPeople know it should drop all items with eyeColour="brown" if all you give it is a collection of people (brownEyedPeople)? The collection does not know what is common to all. Should it look for common properties? it might then drop all people that have an 'm' in their name?
allPeople.Intersect("eyeColour", "brown") would make sense, and require reflection to do it.
BTW: some people have eyes with unequal colours...
|
|
|
|
|
Ahh yes wasn't entirely clear sorry.
Basically I want to do an intersect but only on object properties but retaining the original objects. Either that or can you suggest an a better way to extract objects from a hashset based on criterium? I'm looking to use hashsets better performance to reference objects in memory. Lists and Dictionarys arent doing it for me.
|
|
|
|
|
Hi,
like this?
HashSet< Person> allPeople=new HashSet< Person>();
allPeople.Add(...);
HashSet< Person> somePeople=new HashSet< Person>();
foreach(Person p in allPeople) if (p.EyeColour!="brown") somePeople.Add(p);
BTW: I don't understand what you mean by "Lists and Dictionarys arent doing it for me."
PS: someone is bound to react and say it is much simpler using LINQ.
|
|
|
|
|
I have created ListView With Up and Down buttion. It moves items through list.
I Created as First it removes and then insert it in diffrent Location.
I Have tried using ListView.Items[0].Selected and ListView.Items[0].Focused to true.
The items contiune up whenever i click up, but the selected bar dissapers. How can i correct that issue?
Thanks In Advance
|
|
|
|
|
Add the following:
ListView.EnsureVisible(0);
Hope this will help.
|
|
|
|
|
It didnt help, but i found the solution.
The solution was to focus to control and item must have selected set to true
|
|
|
|
|
Hello,
I'm building an application in the .Net environment with C#, my program is supposed to retrieve data from a database, no problem here, display it, and based on user input after he presses the next button, the information should be saved as he moves along until the end of the program to display the result.
A simple example is like a quiz application, one question at a time, where at the end you calculate the result, and tell the user which questions he got wrong.
So, how can I save the result and incorrect questions every time he clicks next button.
Sorry for the lengthy explanation. Awaiting your help.
Star
|
|
|
|
|
I may have missed the point completely, but can't you just set up a class to hold the info you want, and add an instance of each to a List<T> for processing later?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
I do have a class, but does it save the results throughout the program?
|
|
|
|
|
This is not the recommended way to do this, but I am a little pushed for time...
using System;
using System.Collections.Generic;
namespace Demo
{
class SaveResults
{
public string results;
}
class Program
{
public static List<saveresults> listResults = new List<saveresults>();
static void Main(string[] args)
{
foreach (SaveResults sr in listResults)
{
Console.WriteLine(sr.results);
}
}
}
class Processing
{
void DoSomething()
{
SaveResults sr = new SaveResults();
sr.results = "hello";
Program.listResults.Add(sr);
}
}
}
</saveresults></saveresults>
Each time you get results, you create a new instance of the SaveResults class, storing the info you need later (Processing.DoSomething). You then add this to a static list (in program class here so that it persists until the app ends - you will have a better place, I am sure). When all processing is done, just iterrate through the List<t> and handle each answer in turn.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|