|
Hello,
i want to add a hyperlink of a webpage to my form
is there a way to do it?
i am using the System.Diagnostics.Process.Start... with a file with 'html' extention but this lacks the posibility to open a browser's window in a new page. it runs over existing pages.
tnx,
avi
|
|
|
|
|
If you are IE, then : http://www.ieinfosite.co.uk/tip_view.asp?id=36[^]
"/new" is what you want. Chances are Firefox et al. support this also.
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
|
|
|
|
|
nope.. its still running over existing pages..
looks like the 'new' code is valid only if i specify :
iexplore.exe www.xyz.com -new
but i dont know which browser my client has..
|
|
|
|
|
Hello
What about using a LinkLabel.
Bye
|
|
|
|
|
yes , i did it but my problem is the new link overruns existing pages.
like here i am in this page writing a comment, if i click the link it will be instead of this page and not open a new one.
i want to use the target="..." thing..
|
|
|
|
|
Have a look at this post[^]
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
nope, it still overruns existing pages...
|
|
|
|
|
Hi,
I have a class library, which actuall is a little application itself. It does communication with our server, starts a download queue and autodownloader and does some background processing.
This to provide data and files for the different host app's that are using this class library ( see it as a communications client)
now in the library, i have some events that need to be received by the host app like for example:
FileCountChanged. the problems is, this can be triggered from The AutoDownloader because it finished a download, from the TCP Client cause the server told him to delete a file etc etc..
Now my question is: is there a way to raise a global event from different classes ?
The more or less same question applies to variables ( objects). Can i change the variable of my main class from its sub classes ?
Something like for example:
<br />
<br />
public delegate void FileCountChangedEventHandler(FileType filetype,int count);<br />
public class MyClient<br />
{<br />
<br />
public event FilecountChanged(FileType filetype,int count);<br />
private DownloadQueue _dlqueue = new _dlqueue();<br />
<br />
private AutoDownloader dl = null;<br />
public Myclient()<br />
{<br />
dl = new AutoDownloader(_dlqueue);<br />
dl.start();<br />
dl.DownloadCompleted += new eventhandler(ondownloadcompleted);<br />
}<br />
<br />
<br />
<br />
}<br />
<br />
Thanks !
Do Or Don't, there is no "try catch ex as exception end try"
|
|
|
|
|
Classes shouldn't be raising events that are defined in other classes. If a class MyClient contains some event then it should be up to that MyClient object to determine when to fire it.
If other classes need to manipulate the internal members of the MyClient then there should be some methods to allow controlled access to them. Some of those methods could in turn cause the internal events to be fired.
If you want child classes to be able to add/remove/etc stuff from MyClient s Q, the first job is to make the MyClient accessible by whatever objects need it, either by passing around a reference to it, making a static singleton, or by some other method. Then you can add methods to the MyClient like this:
class MyClient
{
public void AddToQueue(object thingToQ)
{
if (FilecountChanged != null)
{
}
}
}
P.S. code tags make text red, pre tags preserve formatting so they're better for code snippets
|
|
|
|
|
Hi,
Thanks for the reply.
If i understand correctly, making a class a static singleton( have never done that before :s) would make it availble for calling in the Child class, but the instance of the singleton class that the child gets, would be the same instance as the one the host app would have right ?
I'm a VB.net converty ANd relativly new to development so i am still discovering some of the (c#) syntax and possibilities...
Do Or Don't, there is no "try catch ex as exception end try"
|
|
|
|
|
Correct. Your most basic static singleton looks like this:
public class MyClass
{
private static MyClass instance = new MyClass();
public static MyClass Instance
{
get { return instance; }
}
public void DoSomething()
{
Console.WriteLine("Something");
}
} and then all of the objects in your program can access it like this:
MyClass.Instance.DoSomething(); If you have lots of multi-threading in your program then here are some tricks to handle thread-safety with the static object, but in simple programs the basic stuff should suffice.
|
|
|
|
|
I am using visual studio 2005.(Frame work 2.0). I have the database with my application.what i want is while making the setup,i want to include the database too.(so that while installing the setup,I need not to install database seperately)...any idea?? thank you for help me!
I anxiouse for the help. By the way,Give me a example more better
lockepeak
|
|
|
|
|
What database are you using ?
Do Or Don't, there is no "try catch ex as exception end try"
|
|
|
|
|
I had a small application of BHO of c#. I used to do all the things on browser when ever DoCumentcomplete Events gets fired.
I want the browser content not to visible to user intially for sometime (eg., for 1 or 2seconds). How can I do this using c#?
|
|
|
|
|
Hi I had an application of c# which is developed in visual studio 2005, It had been doing well, I had made total into a msi setup.
I want this setup should be valid for some period (eg., for 30days) from the installation date.
How can I lock the code?
|
|
|
|
|
My GPS application can detect not only a Bluetooth GPS receiver but also a GPS/GSM Micro Tracker(it was connected to my application via TCP). I have to send SMS command and it reply back the GPS data(NMEA data - $GPRMC). The problem is that the application can display GPS data($GPGGA) from the Bluetooth GPS receiver but it can't display the data from the gsm machine. Whenever I send sms, I receive back the GPRMC data and I can show it in my textbox but I can't display it on my VE map. The following problem occurs. Thanks in advance. Regards.
http://img172.imagevenue.com/img.php?image=81285_problem2_122_505lo.JPG
The followings are some of my codes.
private void ProcessNMEAData(string data)
{
string[] NMEALine = data.Split('$');
string[] NMEAType;
for (int i = 0; i < NMEALine.Length; i++)
{
NMEAType = NMEALine[i].Split(',');
switch (NMEAType[0])
{
case "GPGGA":
ProcessGPGGA(NMEAType);
break;
case "GPGLL":
break;
case "GPGSA":
break;
case "GPGSV":
break;
case "GPRMC":
ProcessGPRMC(NMEAType);
break;
case "GPVTG":
break;
}
}
}
private void ProcessGPRMC(string[] data)
{
double lat, lon;
double rawLatLong;
rawLatLong = double.Parse(data[3].Replace(":00", ""));
lat = ((int)(rawLatLong / 100)) + ((rawLatLong - (((int)(rawLatLong / 100)) * 100)) / 60);
if (data[4] == "S")
lat *= -1;
rawLatLong = double.Parse(data[5].Replace(":00", ""));
lon = ((int)(rawLatLong / 100)) + ((rawLatLong - (((int)(rawLatLong / 100)) * 100)) / 60);
if (data[6] == "W")
lon *= -1;
if (internetConnected && !loadingFile)
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat("<div>Latitude: {0}<br/>Longitude: {1}<br/>Speed: {2}</div>", lat, lon, data[7]);
AddPushpin(lat, lon, sb.ToString());
}
else if (loadingFile)
{
object[] param = new object[] { lat, lon };
webBrowser1.Document.InvokeScript("AddPoint", param);
}
}
|
|
|
|
|
Hi,
any idea about how to convert excel to pdf using any free printer driver in vb.net
|
|
|
|
|
In a c# forum. I bet you cross posted as well?
Try this[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
in an application i used a trackbar to set input values to an output channel.
The arrow keys left right works fine, the arrow keys left decrement right increment the value.
But the arrow key up decrement and the arrow key down increment the value ??
with the key page up also decrements and the key down increments the value too ?
How could i fix this problem , so that arrow key up increments and arrow keys down decrements,
also the page up down ?
|
|
|
|
|
It's only a bug if you attribute "Up" to increasing the value and "Down" to decreasing it. If you turn the TrackBar vertical, the keys are correct. Visually, it's a bit backwards to reverse the keys.
You can create you're own TrackBar class by inheriting from TrackBar, then override the OnKeyDown method. Check for the appropriate keys and handle the Value of the trackbar yourself, skipping sending the keys to the base OnKeyDown method.
|
|
|
|
|
Hi, thanks for the answer,
i've created my own class, but if the code is running, nothing happens, because
if i press arrow up or down, this.value will correct set, but the control self set's
the value too (so he made the opposite and the control value is allways the same ) !!
Why ? i didnt call the base.OnKeyDown.
public class myTrackbar : TrackBar
{
protected override void OnKeyDown(KeyEventArgs e)
{
if(e.KeyCode == Keys.Up)
{
int delta = this.SmallChange;
this.Value += delta;
}
else if (e.KeyCode == Keys.Down)
{
int delta = this.SmallChange;
this.Value -= delta;
}
}
}
|
|
|
|
|
I want to put datalabels and legendkeys in powerpoint using c#. how to achieve this? here is the code below
private void button1_Click(object sender, EventArgs e)
{
String strTemplate;
strTemplate =
"C:\\Program Files\\Microsoft Office\\Templates\\Presentation Designs\\Blends.pot";
PowerPoint.Application objApp;
PowerPoint.Presentations objPresSet;
PowerPoint._Presentation objPres;
PowerPoint.Slides objSlides;
PowerPoint._Slide objSlide;
PowerPoint.TextRange objTextRng;
Graph.Chart objChart;
Graph.DataSheet dataSheet;
//Create a new presentation based on a template.
objApp = new PowerPoint.Application();
objApp.Visible = MsoTriState.msoTrue;
objPresSet = objApp.Presentations;
objPres = objPresSet.Open(strTemplate,
MsoTriState.msoFalse, MsoTriState.msoTrue, MsoTriState.msoTrue);
objSlides = objPres.Slides;
objSlide = objSlides.Add(1, PowerPoint.PpSlideLayout.ppLayoutTitleOnly);
objTextRng = objSlide.Shapes[1].TextFrame.TextRange;
objTextRng.Text = "My Chart";
objTextRng.Font.Name = "Comic Sans MS";
objTextRng.Font.Size = 48;
objChart = (Graph.Chart)objSlide.Shapes.AddOLEObject(150, 150, 480, 320,
"MSGraph.Chart.8", "", MsoTriState.msoFalse, "", 0, "",
MsoTriState.msoFalse).OLEFormat.Object;
dataSheet = objChart.Application.DataSheet;
dataSheet.Cells[1, 2] = "abc";
dataSheet.Cells[2, 2] = "50";
dataSheet.Cells[2, 3] = "40";
dataSheet.Cells[2, 4] = "50";
dataSheet.Cells[2, 5] = "50";
dataSheet.Cells[3, 2] = "60";
dataSheet.Cells[3, 3] = "70";
dataSheet.Cells[3, 4] = "80";
dataSheet.Cells[3, 5] = "60";
dataSheet.Cells[4, 2] = "50";
dataSheet.Cells[4, 3] = "40";
dataSheet.Cells[4, 4] = "50";
dataSheet.Cells[4, 5] = "50";
objChart.Application.Update();
objChart.Legend.Position = Graph.XlLegendPosition.xlLegendPositionBottom;
objChart.HasTitle = true;
objChart.ChartTitle.Text = "Here it is...";
objPres.SaveAs("C:\\abc.ppt", PowerPoint.PpSaveAsFileType.ppSaveAsPresentation, MsoTriState.msoTrue);
objPres.Close();
objApp.Quit();
}
|
|
|
|
|
Can any 1 tel me how to start working with VOIP..
what should be the 1st step
1st i hv to Make a Simple TAPI Audio Conferencing or something else i hv to start with
Kindly Guide me so that i can Start the Project
|
|
|
|
|
Do some research, read some articles. I found this[^] using Google, it may be more than you are looking for but it should help.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
how to get number of tables in a database (MS Access)using query
|
|
|
|
|