|
There are loads of ways of doing this, here are 2
The simplest and worst of them is to change your controls to be public (I think this works, but would not recommend it)
Expose some public properties on your form to read the variables.
eg.
public string MyTextBoxValue
{
get
{
return TextBox1.Text;
}
}
you can also do clever things with a static factory method on the form which takes parameters as refs
HTH
Russ
|
|
|
|
|
I am trying to places buttons WITHIN a treeview control. SO, up in the top right hand corner you will see several buttons that perform several tasks. I have been able to anchor the buttons to the top right hand corner of the treeview control. However, when I introduce a splitter between TWO treeview controls, the buttons no longer anchor to the top right of the control. This is depedent upon the location of the splitter. For example, if the splitter is placed at the top of the control, then when the splitter is moved up and down, the buttons do not follow. However, they will continue to follow left and right when the form is resized. Any help would be much appreciated. Thanks.
D
|
|
|
|
|
I would use a toolbar placed exactly above the tree view, and not over it. Or put the buttons inside a panel, placed above the tree view.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
The problem with that is, I have two treeveiws ontop of one another. They are separated only by a splitter.
|
|
|
|
|
A splitter works by resizing a control docked to a side of the form. The control that fills the form automatically is resized to keep filling the form. So you can only have two controls, one on each side of the splitter. But those control can be Panels, which can contain other controls.
So, a short solution: put panels on you form and separate them with a splitter. Put the TreeView and the buttons on one Panel , and you're all set.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Thanks for your help. Worked great!
|
|
|
|
|
You're welcome! I'm glad I could help
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Greetings!!
I need to get some text from paragraphs on html pages and i did the next regular expression:
<\s*p[^>]*>(?<1>[\s\S]*)<\s*/\s*p\s*>
where <1> is the group in witch i store all text inside a paragraph.
It works fine on one paragraph.
If i have this sample:
<p> hello 1 </p>
<p> hello 2 </p>
<p> hello 3 </p>
i only get one paragraph that is:
hello 1 </p>
<p> hello 2 </p>
<p> hello 3
What is wrong????
please help me.
thanks.
Bruno Conde.
|
|
|
|
|
It's nothing wrong. The pattern you have made is supposed to work that way.
Make the pattern that mathes the text non-gready by adding a question mark:
[\s\S]*?
---
b { font-weight: normal; }
|
|
|
|
|
Thank you very much for your reply...
It was realy that.
pharaoh
|
|
|
|
|
Hello,
I'm trying to feed a structure to some unmanaged code, the function in the unmanaged code i supposed to fill-in some fields. Can someone help
me translate (marshal) the following to unmanaged code, I have very little experience with this stuff.
Greetz
Dave
Original C++ header code:
typedef struct
{
uint32 uiStructureSize ; // Must be sizeof (tsAT_RETURN_TEMPLATE) (input)
void* pTemplateBfr ; // Buffer to receive template (input/output)
uint32 uiTemplateBfrSize ; // Size of buffer @ pTemplateBfr (input)
uint32 uiTemplateSize ; // Size of template data returned (output)
uint16 uwTemplateQuality ; // Returned template quality (output)
} tsAT_RETURN_TEMPLATE ;
typedef struct
{
uint32 uiStructureSize ;
void* pImageItem ;
void* pOldTemplate ;
BOOL bReturnTemplateOK ;
tsAT_RETURN_TEMPLATE sReturnTemplate ;
} tsAT_BUILD_OR_UPDATE_TEMPLATE ;
My structure's in C#
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct tsAT_RETURN_TEMPLATE
{
public UInt32 uiStructureSize;
public Byte[] pTemplateBfr;
public UInt32 uiTemplateBfrSize;
public UInt32 uiTemplateSize;
public UInt16 uwTemplateQuality;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
public struct tsAT_BUILD_OR_UPDATE_TEMPLATE
{
public UInt32 uiStructureSize;
public Byte[] pImageItem;
public Byte[] pOldTemplate;
public Boolean bReturnTemplateOK;
public tsAT_RETURN_TEMPLATE sReturnTemplate;
}
|
|
|
|
|
how to get the hyperlink column value,from data grid,i show the datagrid in show model dialog box,in run time when i click the column,i want the clicked column value and url field value
m mohamad rafi
|
|
|
|
|
how to get the hyperlink column value,from data grid,i show the datagrid in show model dialog box,in run time when i click the column,the clicked column valu and url field value
m mohamad rafi
|
|
|
|
|
HI All,
Am not an expert here, infact i need an expert to help me.
can any 1 here plz tell how to create an interface which can hold 3d objects in other words, a 3d object library using C#.net
you can directly email to me also.
Jennifer Wadhani
jenniferaahmed@yahoo.com
|
|
|
|
|
There is a directX interface for managed code.
There are loads of samples on the web, it takes abit of getting used to though.
Russ
|
|
|
|
|
How can I make my windows form get maximized onload?
Also, the controls, must I set the size to make it go maximum with respect to the main window?
I want the client window (a control type) to maximize the space left after the menu, toolbars.
|
|
|
|
|
|
emc2 wrote:
Also, the controls, must I set the size to make it go maximum with respect to the main window?
I want the client window (a control type) to maximize the space left after the menu, toolbars.
Use the Dock and Anchor properties to change / set the size of the controls etc., with the changing size of the main window. Experiment with these properties to suit your requirements.
Regards,
Ashok Dhamija
_____________________________
Padam Technologies
|
|
|
|
|
hi
i need help for displaying icons in graph.
|
|
|
|
|
Hi all
i m facing a problem.
I make a HttpWebRequest to a site to login . it logged in succcfullly for the first time. when i press the button and try again to login with same or diffrent user and pass it hangs on HttpWebResponse.GetResponseStream() . I need this stream to post POST data.
if i close the Application and build again and run it works fine.
Thanks in Advance
Regards
TaRiQ
TaRiQ
|
|
|
|
|
I usually see this if I forget to close a response before making a request.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
thanks for reply
but i m closing the response properly and the point is that every thing works fine when i execute it for the first time but as the program is in execuation and i press the login button again to login again it stuck at HttpWebRequest.GetResponseStream().
Please tell me any hint.
Thanks in Advance
Regards
TaRiQ
TaRiQ RaHiM
|
|
|
|
|
Tariq Rahim wrote:
but i m closing the response properly
Are you absolutely sure about this?
Wise from many questions answered, I won't believe you until I see the code for it. Many times I have looked for errors that does not exist in code that is not even executed, just because people say it is...
---
b { font-weight: normal; }
|
|
|
|
|
uri = new Uri("http://login.passport.net/uilogin.srf?lc=1033&id=2");
req =(HttpWebRequest)WebRequest.Create(uri.AbsoluteUri);
req.Method = "POST";
req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4433)";
req.Accept= "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*";
req.Headers.Add("Accept-Language", "en-us");
req.Headers.Add("Cache-Control","no-cache");
req.AllowWriteStreamBuffering=true;
req.KeepAlive = true;
req.Referer = "http://login.passport.com/login.srf?id=2&vv=310&lc=1033";
req.ContentType = "application/x-www-form-urlencoded";
string postdata = "mspppostint="+MSPPT;
byte[] xmlBytes = Encoding.ASCII.GetBytes(postdata);
req.ContentLength = xmlBytes.Length;
// It Stuck here in the GetReuquestStream() as i request for the login 2nd time during the execution of the program
Stream reqStream = req.GetRequestStream();
reqStream.Write(xmlBytes,0,xmlBytes.Length);
// Getting Response of Part I
Response = (HttpWebResponse)req.GetResponse();
stream = new StreamReader(Response.GetResponseStream());
responseHtml = stream.ReadToEnd();
stream.Close();
headers = Response.Headers;
Response.Close();
this is the code and it just stuck at the point where i have writen the comments so pls tell me where i m making wrong
TaRiQ RaHiM
|
|
|
|
|
You have to close the request stream also.
MSDN on GetRequestStream:
CAUTION You must call the Stream.Close method to close the stream and release the connection for reuse. Failure to close the stream will cause your application to run out of connections.
---
b { font-weight: normal; }
|
|
|
|