|
I've created a class that I want to turn into a UserControl but it has no need to be physically visible on the form - like the BackGroundWorker for example, it should only reside in the bar beneath the form in the IDE.
How do I do this?
Dave
|
|
|
|
|
You can add a background worker thread in the UI designer ? I find that pointless, why add it if it's not visible on the form ?
I guess you should look at how the background worker does it. My guess would be that there's an attribute on the class, if it's not derived from the Control classes, that makes it appear in the designer.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
There are several controls that behave like this. All the entries under the Components heading and Dialog heading in the toolbox at least. Adding/being visible in the designer is useful as the Properties Window is then available plus you can see what objects have already been created in InializeComponent().
Still haven't managed to figure this one out but I'll persevere.
Dave
|
|
|
|
|
Just got it!
The class needs to inherit from System.ComponentModel.Component instead of UserControl or Control
Dave
|
|
|
|
|
I am trying to create a UI for my DirectDraw interface that replaces the getto Today screen in Windows Mobile 6. I am using C# managed code to develop the interface.
I realize that there is something called DXUT in the .Net framework that provides functionalty of a UI elements such as a UI Button. Is there such thing for the mobile framework?
If not, I will have to implement my own button. How do i raise an event that checks if the mousetap is within bounds of a button? Do i actually have to implement the code to continously check if the mouse is inside the bounds of the button? Would that cause a high cpu utilization? Some kind of threading? please advice
|
|
|
|
|
hi,
i'm only starting with SQLServer 2005
the Questiuon is:
i have an app (C#) that is a client(in two computers for now).
Do i need to Create some sort of a Thread the will
Re Fill my dataset or does it's managed by the server
or maybe there's an Event that raises every time a Change is made
???
i'm confused
THANKS
Have Fun
Never forget it
|
|
|
|
|
You don't need to create special threads. There is no event in your application when a database change occurs. Your client app cannot tell when the database is changed unless you build your own system that informs all clients.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
So you're saying that i need in the SQLSERVER himself
some kind of an Event or ... to inform the clients
can u refer me to an article about it?
i've got lost searching in google and here
THANKS
Have Fun
Never forget it
|
|
|
|
|
No, I'm saying it doesn't work that way. You'd need to have the client that updates a table to send a broadcast message. Or, SS2005 lets you run .NET code, you may be able to do something with a trigger and a .NET class that sends a message in some way. Typically, tho, databases have never worked that way, it's never been the case that your client app can get a message to say that the DB has changed.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: SS2005
yep i have it
and thanks a lot
i'll try to dig in further
Have Fun
Never forget it
|
|
|
|
|
Maybe you could have a look at the SQLDependency-class, too. It's another way to inform your app that sth. changed on a specific table in your SQL Server 2005 database.
|
|
|
|
|
I have a small form for trying to record but I can't get it to work properly.
I have the code below and I can record and play the created file in this application and other media players. The code creates a 8bit 11kHz mono.
The problem is when I try to use the "set" parameters, any of them, then I can only play it back in this application, not with any other players.
Am I doing something wrong?
using Microsoft.VisualBasic.Devices;<br />
using Microsoft.VisualBasic;<br />
using System.Runtime.InteropServices;<br />
using System.Windows.Forms;<br />
<br />
namespace Recorder<br />
{<br />
public partial class Form1 : Form<br />
{<br />
[DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]<br />
private static extern int mciSendString(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback);<br />
<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
}<br />
<br />
private void buttRecord_Click(object sender, System.EventArgs e)<br />
{<br />
mciSendString("open new Type waveaudio Alias recsound", "", 0, 0);<br />
<br />
mciSendString("format tag pcm", "", 0, 0);<br />
mciSendString("set recsound channels 2", "", 0, 0);<br />
<br />
mciSendString("record recsound", "", 0, 0);<br />
}<br />
<br />
private void buttSaveStop_Click(object sender, System.EventArgs e)<br />
{<br />
mciSendString("save recsound c:\\record.wav", "", 0, 0);<br />
mciSendString("close recsound ", "", 0, 0);<br />
Computer c = new Computer();<br />
c.Audio.Stop();<br />
}<br />
<br />
private void buttPlay_Click(object sender, System.EventArgs e)<br />
{<br />
Computer computer = new Computer();<br />
computer.Audio.Play("c:\\record.wav", AudioPlayMode.Background);<br />
}<br />
}<br />
}
|
|
|
|
|
I have a web application which i installed it on a computer, now i had some changes in the application and want to add a version number to the MSI file. Hou can I do that? IS there anything provided in microsoft documentation?
thanks
robust
|
|
|
|
|
The app version number is stored in the app.config file, I believe. But when I build an MSI, I put the version number in the title.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi there,
I am new in C#,
I am writing a C# application , I need it to be a program that must be installed after that it should start running ones the windows starts up, even before login .
what are the steps can I make so my application be installed by the user
and then how can I make it run before log on windows
Thanks
There is always something to learn
|
|
|
|
|
To run before login, the application must be a Windows Service. That's one of the project types in Visual Studio so your first step is to create your app as a service. You then need to add a service installer so that it can be installed in the service manager.
|
|
|
|
|
Thank you,
but I am not very familiar with the windows services ,
so would mind sending me resources that I can learn how to build a service
and how to deal with the service installer
There is always something to learn
|
|
|
|
|
|
hi again,
thank you very much for the help,
after building my service before the login to the windows , I want to make sure that the service really works , and I was wondering if there is a way to make the service to perform the login to a specific user account ,
if there is such a way, would please send me back
or guide me where to find kind of tutorials about the windows(operating System) functions and what possible things I can let may C# windows service do.
thanks
There is always something to learn
|
|
|
|
|
Is anyone able to help me get this to work? Im not that familiar with the Windows API and have been fiddling around with this for days
<br />
using System;<br />
using System.Runtime.InteropServices;<br />
<br />
namespace System<br />
{<br />
public class WorkingArea<br />
{<br />
[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]<br />
[return:MarshalAs(UnmanagedType.Bool)]<br />
public static extern bool SendMessageTimeout(IntPtr hWnd,int Msg,string lParam,int uTimeout,int lpdwResult);<br />
<br />
public struct RECT<br />
{<br />
public int Left;<br />
public int Top;<br />
public int Right;<br />
public int Bottom;<br />
}<br />
[DllImport("User32.dll", EntryPoint = "SystemParametersInfoA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]<br />
private static extern short SystemParametersInfo(short uAction, short uparam, ref RECT lpvParam, short fuWinIni);<br />
[DllImport("user32", EntryPoint = "PostMessageA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]<br />
private static extern int PostMessage(int hwnd, int wMsg, int wParam, ref int lParam);<br />
<br />
<br />
public const int HWND_BROADCAST = 0xffff;<br />
public const int WM_SETTINGCHANGE = 0x001A;<br />
public const int SMTO_NORMAL = 0x0000;<br />
public const int SMTO_BLOCK = 0x0001;<br />
public const int SMTO_ABORTIFHUNG = 0x0002;<br />
public const int SMTO_NOTIMEOUTIFNOTHUNG = 0x0008;<br />
public const int SPIF_SENDCHANGE = 0x02;<br />
public const short SPI_SETWORKAREA = 47;<br />
<br />
public void SetWorkArea(RECT rect)<br />
{<br />
SystemParametersInfo(SPI_SETWORKAREA, 0,ref rect, SPIF_SENDCHANGE);<br />
}<br />
}<br />
}
ie.
WorkingArea WorkSpace = new WorkingArea();<br />
RECT Area = new WorkingArea.RECT();<br />
Area.Left=25;<br />
Area.Top=25;<br />
Area.Bottom=25;<br />
Area.Right=25;<br />
WorkSpace.SetWorkArea(Area);
------------------------
|
|
|
|
|
I'm writing a small application at work (programming isn't my primary job function at the moment). I'm using Access to keep track of some information...it's mostly static. At the moment the application and the access database reside on a network share because a few people in my department need to access it. However, I'm using ReportViewer in Visual Studio 2008 and the ReportViewer dlls aren't installed on any of our office machines. If I stick the dlls on the network share they're aren't recognized. I don't have administrative rights to install them on each machine. My thoughts are to zip on up the application and put it on each machine with the dlls files included.
However, the access database needs to remain on the network share so that each user only accesses the one copy of the database. I'm planning on leaving the company in a couple months and no one in my department knows C#. If the network share's URI changes in the future, the application will break. Are they any suggestions for a way to have users be able to change the URI within the application and if it use that URI in the future if for some reason it changed? I want to make it as easy as possible for some of the folks here. I'd rather not have to come back and fix the application in the future just because they decide they need to restructure every year.
|
|
|
|
|
Hi everyone,
I am developing for my company a project management system using C# / .NET and MVP pattern. Now I encouter the following design problem:
- I have a project selector GUI containing the list of all available projects where the user can choose one or several project(s) like this:
---------
Please choose one or several projects:
Project 1
Project 2
Project 3
....
Project n
[Open button]
----------
- After choosing one or several projects, a tab appears displaying all project names and the project structure in tree form of the currently tabed-active project is displayed. The project tree consists of working packages and workitems while working packages can in turns contain work items or working items itself (composit pattern), something like this
Project 1
---Kick off phase
---Specification analyze
---- Analyze A
-----Analyze B
---Implementation
.....
The user can click on the item in the project tree have the detailed information displayed, e.g. detailed information of the current project when the root node (Project 1 above) is selected or of working package when a working package node is selected and of work item when a work item is selected.
My question is: how to model all that stuffs in MVP pattern. I guess it would make sence to have a MVP triad like ProjectStructureView - ProjectStructurePresenter - ProjectStructureModel. But should I have each MVP triad for each kind of project item in the tree (project, package, workitem) ?
The fact is, all the displayed information for the current project has only to do with project.
So the other question is: what should be stored in for example ProjectStructureModel?
Your answer would be really appreciated!
Regards.
|
|
|
|
|
Quang Tran Minh wrote: My question is: how to model all that stuffs in MVP pattern.
See Model[^]
See Design[^]
Quang Tran Minh wrote: So the other question is: what should be stored in for example ProjectStructureModel?
See Data Model[^]
led mike
|
|
|
|
|
|
papadimitriou wrote: that was a very cynical answer.
cynical?
led mike
|
|
|
|