|
Hi I'm from Macedonia and I'm learning about listView in Visual Studio 2008 c#.
If someone can tell me HOW to:
open a Windows Form by duoble click in some of the listView row's?
And how to print the listView that is filled with data from the dataBase.
P.S.
Answer me as fast as you can
Thanks
Zive T.
|
|
|
|
|
3.3..3 wrote: Hi I'm from Macedonia
Hi,I am from Republic of Kosova.
Opening new form from doubleclick event of listview1 then code is:
private void listView1_DoubleClick(object sender, System.EventArgs e) <br />
{<br />
NewFormName frmOpen = new NewFormName(); <br />
fromOpen.Show();<br />
}
3.3..3 wrote: And how to print the listView
Do you mean printing in printer or you mean something else?
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
3.3..3 wrote:
P.S.
Answer me as fast as you can
This is as rude as your subject line is useless. Everyone here 'needs help'.
3.3..3 wrote: open a Windows Form by duoble click in some of the listView row's?
By catching the event and opening the form
3.3..3 wrote: And how to print the listView that is filled with data from the dataBase.
I suggest you read the chapter in your C# book on printing. You have a book, right ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
i not sure if you want to do that, i think you have an assignment and you don´t have a clue on how to do it
the suitable object you need is the datagridview, you have to fill it with the data from your database
(i assume you have already a database and you can manage to code the connnection between the application and database)
to display the report in the application or print it you need crystal reports document and viewer
(you can also display the data in the datagridview if you wish)
remember, any scheme of data (from your database) can be display in the datagridview, but in your cristal report document you have to built a scheme that is a 100% match to the scheme in your database table
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
So want to break them right now on the "How to answer a question!"
|
|
|
|
|
You are indeed an inspiration to us all.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi! Im trying to pause spotify by sending a space to the application.
Im using this code but when i click button1 i get a message telling me "An error occurred in the application"
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
[DllImport("USER32.DLL", CharSet = CharSet.Unicode)]
public static extern IntPtr FindWindow(string lpClassName,
string lpWindowName);
[DllImport("USER32.DLL")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
IntPtr SpotHandle = FindWindow("SpotifyMainWindow", null);
if (SpotHandle == IntPtr.Zero)
{
MessageBox.Show("Spotify är ej igång");
return;
}
SetForegroundWindow(SpotHandle);
SendKeys.SendWait("{SPACE}");
}
}
}
Why doesnt this code work?
|
|
|
|
|
Debug the application; during which line of code do you receive this error?
Adam Maras | Software Developer
Microsoft Certified Professional Developer
|
|
|
|
|
I got it working by using:
SendKeys.SendWait(" ");
instead of:
SendKeys.SendWait("{SPACE}");
|
|
|
|
|
Wow - there's a revelation. What made you think that the word SPACE would work ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
For future reference, you only need to use the "{xxx}" when it's a character that isn't displayed when pressed.
Full list here[^].
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Hi,
I am thinking of doing some webcam development using C# and DirectShow. I have never done anything like this before. I am using Visual Studio 2008 and was wondering what other downloads/library’s I will need in order to use DirectShow.
I am currently downloading Windows SDK for Windows Server 2008 and .NET Framework 3.5, will this contain all the libraries that are necessary?
(This is 1.3GB on a very slow connection so tell me if I’m completely wrong!!!)
I know that there are a lot of good looking examples and tutorials (including this site) about using webcams on the internet but if anybody has any they especially recommend I would appreciate it a lot.
Thanks in advance,
Mark
|
|
|
|
|
|
I am trying to access a listbox in a class that is not Form1.cs but I am having difficulty. How do I access this list box?
I have tried:
public class DeckManagement: Form
and
public class DeckManagement: WarGame
|
|
|
|
|
Your code seems totally irrelevant to the problem at hand.
Nathan Revka wrote: but I am having difficulty
Does it not compile, or do you get a runtime error? I would guess you need to make WarGame a public inner class of Form1, but that is terrible design - you should have WarGame as a full class in its own right, in WarGame.cs.
Cheers,
Vikram. (Proud to have finally cracked a CCC!) Recent activities:
TV series: Friends, season 10
Books: Fooled by Randomness, by Nassim Nicholas Taleb. Carpe Diem.
|
|
|
|
|
It is probably a better idea to expose a public method or property in your Form1 class that you would execute from your satellite class.
For example, if you needed to access the listbox from a different class so you can retrieve the selected index, you might within your Form1 class expose a public method:
public partial class Form1
{
...
public int GetListSelectedIndex()
{
return listBox1.SelectedIndex;
}
...
}
|
|
|
|
|
Hi guys
Can anyone show me where there are any tutorials on making a basic server in C#. Something that will run on port X and other computers in that network will be able to contact to the server and the server send a response (plain text).
Thanks guys
|
|
|
|
|
|
Cool
Thanks for the links.
|
|
|
|
|
i m creating a bot for a browser game, i really in the start yet
so, i enter the page and i need to pass password and username etc
so i found that code in vb but i cant find the translation
i so thing i missing a assembly case its really simple
...
wb.documents.all("username").value = "qwerty1"
wb.documents.all("password").value = "qwerty2"
wb.documents.all("submit").value = click
...
thanks
wb is WebBrowser object
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
There are online converters that will do this. If you can't do it yourself, then perhaps you need to understand C# better instead of just copying and pasting code from the web ?
Replace the () with [] and put a ; at the end. That is all.
Except I am not sure that the last line will work, in VB or C#, unless click is a variable that's already defined.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
() or [] doesn´t matter, like i said before i am missing a assembly, i cant find it
i used value propriety before, to pass values to db for exemple
... sql_cmd.Parameters.Add("@my_season", SqlDbType.Int).Value = season; ...
but i cant find the assembly to value propriety this case in order to pass values to site login page
nelsonpaixao@yahoo.com.br
trying to help & get help
modified on Wednesday, July 29, 2009 7:20 PM
|
|
|
|
|
In this code, I want to set the color of the progress bar to one thing, wait, then set it to something else, each time timer1 ticks. It doesn't work. Any suggestions?
private void timer1_Tick(object sender, EventArgs e)
{
progressBar2.ForeColor = Color.Firebrick;
Thread.Sleep(50);
progressBar2.ForeColor = Color.Black;
}
|
|
|
|
|
Firstly, at 50ms you won't see anything.
Secondly, why don't you just keep the timer ticking and each time you just swap the colours.
Thirdly, Sleep on the UI thread is, no mater how short, not a good idea.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
You'll need a thread.
See here[^].
|
|
|
|