In this code Contents and Index are working but Search doesn't.I am not sure that HelpNavigator.Find is OK? Is there some other way to display Search from chm file?
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;
namespace Spomenik
{
public partial class Pomoc : Form
{
public Pomoc()
{
InitializeComponent();
}
private void Help_Click(object sender, EventArgs e)
{
System.Windows.Forms.Help.ShowHelp(this, "..\\..\\Slika\\SpomenikPomoc.chm");
//Help.Show(this, "..\\..\\Slika\\SpomenikPomoc.chm"); ne radi jer mi je Help naziv dugmeta
}
private void Index_Click(object sender, EventArgs e)
{
System.Windows.Forms.Help.ShowHelpIndex(this, "..\\..\\Slika\\SpomenikPomoc.chm");
}
private void Search_Click(object sender, EventArgs e)
{
**System.Windows.Forms.Help.ShowHelp(this, "..\\..\\Slika\\SpomenikPomoc.chm", HelpNavigator.Find);**
}
}
}
Specify an empty string ("") as the last parameter:
Help.ShowHelp(this, "..\\..\\Slika\\SpomenikPomoc.chm", HelpNavigator.Find, "");
From Help.ShowHelp Method (Control, String, HelpNavigator, Object):
If the value specified in the command parameter is TableOfContents, Index, or Find, this value should be an empty string.
Reflector shows that the ShowHelp version with 3 parameters uses null as the 4th parameter, rather than "". Probably that is why Find doesn't work. You need to use the "full" method version with all the needed parameters.
Related
i am new to .net i am having trouble playing videos automatically. I would be showing different textboxes here but i want the video to autplay without any buttons
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WMPLib;
namespace ThinkQDisplay
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void axWindowsMediaPlayer1_Enter(object sender, EventArgs e)
{
AxWindowsMediaPlayer1.URL = "C:\Users\Ramrod\Documents\Visual Studio 2012\Projects\ThinkQDisplay\ThinkQDisplay\sample.avi";
}
}
}
It keeps telling it is an unrecognized escape sequence. Also I would like to have a separate form (form2). Where I can choose what to play here on form 1. Is it also possible to have it looped?
private void axWindowsMediaPlayer1_Enter(object sender, EventArgs e)
{
axWindowsMediaPlayer1.URL = #"C:\Users\Ramrod\Documents\Visual Studio 2012\Projects\ThinkQDisplay\ThinkQDisplay\sampler.avi";
}
private void Form1_Load(object sender, EventArgs e)
{
axWindowsMediaPlayer1.settings.autoStart = true;
}
}
}
I am in need of a bit of help searched around the internet for about 2 days
to try and figure out how i can call an AxShockwaveFlash Variable from a second form this is for a game trainer something simple just getting into C# so i thought id start with one of these however i love everything i make to have a nice look and as many options as i can add so for my first C# Trainer i added a MenuStrip that opens a second form(VariableMods.cs) it has a few radio buttons a text box 3 toggle switches and 2 buttons one for setting a variable to whatever is typed in the text box while checking which radio button is checked and a button to close the variable menu which is another thing i need a bit of help with
-How do i Close the Second Form but still keep my Toggles On?
-How do i Call A Variable From (Form1.cs) to Form2(VariableMods.cs)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OCULAS
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//Show the Variable ModMenu
private void openVariableModsToolStripMenuItem_Click(object sender, EventArgs e)
{
VariableMods VarMenu = new VariableMods(this);
VarMenu.Show();
}
//Show About Program Box
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
InfoBox1 AboutBoxx = new InfoBox1();
AboutBoxx.Show();
}
//Close the Program
private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
That is my Form1 Code Have Not Put anything into it about the ShockwaveFlash yet
And
here is Form2(VariableMods)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OCULAS
{
public partial class VariableMods : Form
{
Form1 originalForm; //Using "OriginalForm" To Call "Form1"
public VariableMods(Form1 IncomingForm)
{
originalForm = IncomingForm; //originalForm(Form1) is the form to be called
InitializeComponent();
BoxHeadVariables utf = new BoxHeadVariables();
}
private void ambiance_Button_21_Click(object sender, EventArgs e)
{
this.Hide();
}
private void ambiance_Button_11_Click(Form1 incomingForm, object sender, EventArgs e)
{
if (ambiance_RadioButton1.Checked == true)
{
MessageBox.Show("Damage Mod Is Active");
}
if (ambiance_RadioButton2.Checked == true)
{
MessageBox.Show("Speed Mod Is Active");
}
if (ambiance_RadioButton3.Checked == true)
{
MessageBox.Show("Range Mod Is Active");
}
}
}
}
I did some research about this error, and all awnsers i found include removing static from the method or the property, but in my code there isnt any static, so i dont know whats happening, thanks for your help.
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;
namespace WindowsFormsApplication1
{
public partial class textoTitular : Form
{
public textoTitular()
{
InitializeComponent();
}
private void textoTitular_Load(object sender, EventArgs e)
{
textoTitular.Text = "testing"; /// prints testing on the textbox
}
}
}
Your problem is in
private void textoTitular_Load(object sender, EventArgs e)
{
textoTitular.Text = "testing"; /// prints testing on the textbox
}
You are referencing the form class in a static way.
Rather try using this. Something like
private void textoTitular_Load(object sender, EventArgs e)
{
this.Text = "testing"; /// prints testing on the textbox
}
Added bonus, you can omit the this and use the object property
private void textoTitular_Load(object sender, EventArgs e)
{
Text = "testing"; /// prints testing on the textbox
}
I have created a database in microsoft office access. In form1.cs i added a DataGridView with the source from the database created. In tableDataSet.xsd/tabelAdapter i created a new query with 3 parameters which i use to insert the data in the database ( Name, Password, Age) . how can i use this query with that 3 parameters from 3 different textbox?
PS: i use only Windows Form Application, no asp.net or etc.
Code:
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;
namespace lucian
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'jucatoriDataSet.jucator' table. You can move, or remove it, as needed.
this.jucatorTableAdapter.Fill(this.jucatoriDataSet.jucator);
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void adaugareToolStripButton_Click(object sender, EventArgs e)
{
try
{
this.jucatorTableAdapter.Fill(this.jucatoriDataSet.jucator);
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
}
private void button1_Click(object sender, EventArgs e)
{
}
}
}
Take a look at that article http://msdn.microsoft.com/en-us/magazine/cc163709.aspx
Basically you need to learn about ADO.NET :)
I am creating a application form to view/change a tag from a software called InTouch.
I added the dll as a reference and I would like to use the Read(string tagName) fct in the IOM.InTouchDataAccess. VS does not see the fct Read when I write InTouchWrapper TagType = new read(). It only sees InTouchWrapper as I wrote in the code which gives me the error IOM.InTouchDataAccess.InTouchWrapper' does not contain a constructor that takes 0 arguments
I don't understand why is this happening. I am running the InTouch software while coding, maybe there is an access conflict with the software.
MyCode
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 IOM.InTouchDataAccess;
namespace TagBrowser
{
public partial class TagBrowser : Form
{
public TagBrowser()
{
InitializeComponent();
}
private void TagBrowser_Load(object sender, EventArgs e)
{
}
private void TagBox_TextChanged(object sender, EventArgs e)
{
}
private void TypeBox_SelectedIndexChanged(object sender, EventArgs e)
{
InTouchWrapper TagType = new InTouchWrapper();
}
The dll
using System;
using System.Collections.Generic;
using System.Text;
using NDde.Client;
namespace IOM.InTouchDataAccess
{
public class InTouchDdeWrapper : IDisposable
{
private int DDE_TIMEOUT = 60000;
private DdeClient _ddeClient;
public InTouchDdeWrapper()
{
_ddeClient = new DdeClient("View", "Tagname");
}
~InTouchDdeWrapper()
{
Dispose();
}
public void Initialize()
{
_ddeClient.Connect();
}
public string Read(string tagName)
{
return _ddeClient.Request(tagName, DDE_TIMEOUT).Replace("\0", "");
}
I'm putting this here in case somebody else would get the same problem:
Are you sure it's the correct dll you referenced? Try to open the
exact referenced dll in a decompiler (JustDecompile free,
Reflector or dotPeek free) and see if it's the code you
expect.